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

Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x