List all databases and tables

Published by onesixx on

 

databases

SELECT datname FROM pg_database
WHERE datistemplate = false;

 

 

tables

SELECT table_name
FROM information_schema.tables
where table_catalog='tablespace' 
and table_schema='public'
and table_type='BASE TABLE'
ORDER BY 1;

 

 

Categories: Postgresql

onesixx

Blog Owner

Leave a Reply

Your email address will not be published.