← flaviocopes.com

How to list tables in the current database using PostgreSQL

Published Jan 04 2020

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;

Check out my books 👇🏼

© 2023 Flavio Copes Flavio Copes using Notion to Site Notion to Site

Interested in solopreneurship?