How to list tables in the current database using PostgreSQL
New Courses Coming Soon
Join the waiting lists
A quick explanation of how to list tables in the current database inside the `psql` tool in PostgreSQL, or using SQL
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;
→ Read my SQL Tutorial on
The Valley of Code
Here is how can I help you:
- COURSES where I teach everything I know
- CODING BOOTCAMP cohort course - next edition in 2025
- THE VALLEY OF CODE your web development manual
- BOOKS 17 coding ebooks you can download for free on JS Python C PHP and lots more
- Interesting links collection
- Follow me on X