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:

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;

~~~

Related posts about database: