Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the output of \dt mean?

Tags:

postgresql

postgres=# \c students
You are now connected to database "students" as user "postgres".
students=# \dt;
 public | student | table | postgres

students=# \dt+
 public | student | table | postgres | 0 bytes | 

students=# 

What does the output of \dt mean? I only only know there is a table student under database students beforehand.

I am using psql (9.6.6).

Thanks.

like image 643
Tim Avatar asked Oct 20 '25 21:10

Tim


1 Answers

\dt (no parameters) appears to list all the tables in the current schema, as the docs here explain: http://www.postgresonline.com/special_feature.php?sf_name=postgresql83_psql_cheatsheet

Your output is one row showing the (one) student table. If I create one table, similarly, I get this:

 postgres=# \dt
         List of relations
 Schema |  Name   | Type  | Owner  
--------+---------+-------+--------
 public | student | table | postgres
(1 row)

Do \dt+ to see slightly expanded information.

like image 74
Rohan Varma Avatar answered Oct 22 '25 12:10

Rohan Varma