Show Tables in PostgreSQL Command

In this post, we will provide the psql command to choose a specific database and show all its tables.

Connect or switch to a specific database

\c database_name
For example, the following command connects to the "employees" database:
mydb=# \c employees
You are now connected to database "employees" as user "postgres".

Lists all tables in a current database

mydb=# \dt
         List of relations
 Schema | Name  | Type  |  Owner
 public | users | table | postgres
(1 row)

Free Spring Boot Tutorial - 5 Hours Full Course

Watch this course on YouTube at Spring Boot Tutorial | Fee 5 Hours Full Course