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 table, d.description | |
FROM pg_catalog.pg_description d | |
LEFT JOIN pg_class c | |
ON d.objoid = c.oid | |
WHERE d.objsubid = 0 | |
AND c.relname is not null |
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 * from information_schema.columns where table_schema in (select schema_name from information_schema.schemata where schema_owner <> 'postgres') |
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
WITH tables | |
AS (SELECT oid, | |
relname AS table | |
FROM pg_class), | |
columns | |
AS (SELECT ordinal_position AS objsubid, | |
table_name AS table, | |
column_name AS column | |
FROM information_schema.columns) | |
SELECT t.table, |