Last active
January 20, 2024 08:41
-
-
Save sawirricardo/46672850859b0780132436ebe49f1e01 to your computer and use it in GitHub Desktop.
get all tables postgreSQL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
c.relname as name, | |
n.nspname as schema, | |
pg_total_relation_size (c.oid) as size, | |
obj_description (c.oid, 'pg_class') as comment | |
from | |
pg_class c, | |
pg_namespace n | |
where | |
c.relkind in ('r', 'p') | |
and n.oid = c.relnamespace | |
and n.nspname not in ('pg_catalog', 'information_schema') | |
order by | |
c.relname; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment