Created
August 30, 2017 18:42
-
-
Save brambow/b20fd5a1f3a6c3673245e9ff6618be8b to your computer and use it in GitHub Desktop.
PostgreSQL Data Dictionary
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 DISTINCT ON | |
( table_schema, table_name, ordinal_position ) table_schema, | |
table_name, | |
ordinal_position, | |
column_name, | |
data_type, | |
column_default, | |
is_nullable, | |
pg_description.description | |
FROM | |
information_schema.columns | |
JOIN pg_catalog.pg_class ON pg_class.relname = columns.table_name | |
LEFT OUTER JOIN pg_catalog.pg_description ON pg_description.objoid = pg_class.relfilenode | |
AND pg_description.objsubid = columns.ordinal_position | |
WHERE | |
table_schema IN ( 'wq', 'logging' ) | |
ORDER BY | |
table_schema, | |
table_name, | |
ordinal_position |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment