list all tables in postgres 1

list all tables in postgres

PostgreSQL show tables command
	
\dt

Here is what the above code is Doing:
1. We’re creating a new table called “test_table”
2. We’re telling PostgreSQL that the table has two columns: “id” and “name”
3. We’re telling PostgreSQL that the “id” column is an integer and that it should auto-increment
4. We’re telling PostgreSQL that the “name” column is a variable character field (varchar) of maximum length 255
5. We’re telling PostgreSQL that the “name” column should not be empty
6. We’re telling PostgreSQL that the “id” column should be the primary key (unique identifier) for the table

Similar Posts