Commands show nothing (Learn Relational Databases by Building a Mario Database)

The list and display commands show nothing:

\l
\list

\d
\d table_name

However, they are taken as valid. What’s happening? :slight_smile:

Edit:

Now I’m stuck.

  1. Enter "\d second_table " into the prompt

second_database=> \d second_table

ctrl + enter

You should display the details of “second_table”

a. I reset the progress
b. I ensure I’m using the right DB

=> psql --username=freecodecamp dbname=second_database

c. I run the display command again

=> \d second_table

Nothing is displayed.

=> CREATE TABLE second_table();
ERROR: relation “second_table” already exists

=> ctrl + enter

You should display the details of “second_table”

It sounds like you tried most things - it looks like your doing it correct. Perhaps if you shared a screen shot, I could maybe see something we might be missing.

Just to be clear, you’re supposed to type \d second_table in the prompt and press enter - not ctrl + enter. I assume you did that, but I don’t see it in your code. It should look like this: second_database=> \d second_table (then press enter)

I’d just want to point out that this issue still seems to exist; I’m getting the same problem randomly with any command in PostgreSQL. I can do a proper command and get nothing back as a result, and the only way to fix this is to disconnect from PostgreSQL and connect back, though now I noticed I had to do this twice in order to get any command working.


mario_database=> UPDATE characters SET name='Toad' WHERE name='Toadstool';
mario_database=> SELECT * FROM characters;
mario_database=> SELECT * FROM characters;
mario_database=> SELECT * FROM characters;
mario_database=> SELECT * FROM characters;
mario_database=> \d
mario_database=> exit
codeally@a85a4a32bcb5:~/project$ psql --username=freecodecamp dbname=postgres
Border style is 2.
Title is " ".
Pager usage is off.
psql (12.9 (Ubuntu 12.9-2.pgdg20.04+1))
Type "help" for help.

postgres=> \l
                                   List of databases
+----------------+--------------+----------+---------+---------+-----------------------+
|      Name      |    Owner     | Encoding | Collate |  Ctype  |   Access privileges   |
+----------------+--------------+----------+---------+---------+-----------------------+
| mario_database | freecodecamp | UTF8     | C.UTF-8 | C.UTF-8 |                       |
| postgres       | postgres     | UTF8     | C.UTF-8 | C.UTF-8 |                       |
| template0      | postgres     | UTF8     | C.UTF-8 | C.UTF-8 | =c/postgres          +|
|                |              |          |         |         | postgres=CTc/postgres |
| template1      | postgres     | UTF8     | C.UTF-8 | C.UTF-8 | =c/postgres          +|
|                |              |          |         |         | postgres=CTc/postgres |
+----------------+--------------+----------+---------+---------+-----------------------+
(4 rows)

postgres=> \c mario_database 
You are now connected to database "mario_database" as user "freecodecamp".
mario_database=> \d
mario_database=>                         List of relations
+--------+-----------------------------+----------+--------------+
| Schema |            Name             |   Type   |    Owner     |
+--------+-----------------------------+----------+--------------+
| public | characters                  | table    | freecodecamp |
| public | characters_character_id_seq | sequence | freecodecamp |
+--------+-----------------------------+----------+--------------+
(2 rows)


mario_database=> 
mario_database=> \d characters
                                             Table "public.characters"
+----------------+-----------------------+-----------+----------+--------------------------------------------------+
|     Column     |         Type          | Collation | Nullable |                     Default                      |
+----------------+-----------------------+-----------+----------+--------------------------------------------------+
| character_id   | integer               |           | not null | nextval('characters_character_id_seq'::regclass) |
| name           | character varying(30) |           | not null |                                                  |
| homeland       | character varying(60) |           |          |                                                  |
| favorite_color | character varying(30) |           |          |                                                  |
+----------------+-----------------------+-----------+----------+--------------------------------------------------+

mario_database=> SELECT * FROM characters;
                               
+--------------+--------+------------------+----------------+
| character_id |  name  |     homeland     | favorite_color |
+--------------+--------+------------------+----------------+
|            1 | Mario  | Mushroom Kingdom | Red            |
|            2 | Luigi  | Mushroom Kingdom | Green          |
|            3 | Peach  | Mushroom Kingdom | Pink           |
|            5 | Bowser | Mushroom Kingdom | Green          |
|            7 | Yoshi  | Dinosaur Land    | Green          |
|            6 | Daisy  | Sarasaland       | Orange         |
|            4 | Toad   | Mushroom Kingdom | Red            |
+--------------+--------+------------------+----------------+
(7 rows)

Any idea what this could have to do with? Using Vivaldi on Windows.

Thanks for sharing @PixelDust - that does seem quite strange. You are connected, so I don’t know - I’ve never seen that happen. Have you tried another browser? CodeAlly officially supports Chrome, Safari, Firefox, and Opera I think.