Skip to content
FLAVIO COPES
flaviocopes.com
2026

How to list tables in the current database using PostgreSQL

By Flavio Copes

Learn how to list the tables in the current PostgreSQL database using the dt command in psql, or a SQL query against the information_schema.tables view.

~~~

To list the tables in the current database, you can run the \dt command, in psql:

Terminal showing psql dt command output with table list displaying Schema, Name, Type, and Owner columns for 5 database tables

If you want to perform an SQL query instead, run this:

SELECT table_name
FROM information_schema.tables
WHERE table_schema = 'public'
ORDER BY table_name;

Terminal showing SQL query result listing table names from information_schema.tables with 5 table names displayed

Tagged: Database ยท All topics
~~~

Related posts about database: