Monday, October 28, 2013

Listing all tables in PostGreSQL DB

You should be able to just run
select * from information_schema.tables
to get a listing of every table being managed by Postgres for a particular database.

You can also add a where table_schema = 'information_schema' to see just the tables in the information schema.

This is another version to get the specific results:

SELECT *
FROM information_schema.tables
WHERE table_schema='public'
AND table_type='BASE TABLE';