This article is half-done without your Comment! *** Please share your thoughts via Comment ***
In this post, I am sharing two commands of PSQL for getting the list of tables and databases in PostgreSQL.
PSQL is a handy tool for PostgreSQL DBAs and they are always preferring to use a command line tool.
This article is for PostgreSQL beginner who is looking for the list of tables and databases in PostgreSQL.
Get the list of databases:
1 2 3 |
-psql> \list or -psql> \l |
Get the list of tables:
You can’t get the list of all tables of all databases, but you can get the list of all tables of a particular database.
First, you need to connect the database and then execute below command.
1 |
-psql> \dt |
How to connect the database in PSQL?
1 |
-psql>\connect database_name |
Leave a Reply