PostgreSQL - How to list all available tables?
How to show all available tables in PostgreSQL?
1. Using SQL Query
To show the list of tables with the corresponding schema name, run this statement:
SELECT * FROM information_schema.tables;
or in a particular schema:
SELECT * FROM information_schema.tables WHERE table_schema = 'schema_name';
2. Using psql
To list all tables:
- In all schemas:
\dt *.*
- In a particular schema:
\dt schema_name.*
3. Using TablePlus
In TablePlus, you can either use the query editor to run the statements above or see the list of the tables in the current schema on the left sidebar of the workspace.
To switch and see tables from another schema, navigate to the dropdown schema list at the bottom of the left sidebar and select the schema.
Need a good GUI tool for PostgreSQL? Check out TablePlus. It’s native, beautiful, and available for free.
Not on Mac? Download TablePlus for Windows.