PostgreSQL: Show tables in PostgreSQL

flybywire picture flybywire · Apr 20, 2009 · Viewed 2M times · Source

What's the equivalent to show tables (from MySQL) in PostgreSQL?

Answer

Mihai Limbășan picture Mihai Limbășan · Apr 20, 2009

From the psql command line interface,

First, choose your database

\c database_name

Then, this shows all tables in the current schema:

\dt

Programmatically (or from the psql interface too, of course):

SELECT * FROM pg_catalog.pg_tables;

The system tables live in the pg_catalog database.