Skip to content

Instantly share code, notes, and snippets.

@rcackermanCC
Last active August 29, 2015 14:21
Show Gist options
  • Select an option

  • Save rcackermanCC/2e7ad013d32e835ff52a to your computer and use it in GitHub Desktop.

Select an option

Save rcackermanCC/2e7ad013d32e835ff52a to your computer and use it in GitHub Desktop.
Roll your own data dictionary
SELECT
table_name,
column_name,
data_type,
col_description(concat('public.',table_name)::regclass, ordinal_position)
FROM information_schema.columns where table_name like '<stuff>';
SELECT distinct
table_name,
obj_description(concat('public.',table_name)::regclass, 'pg_class')
FROM information_schema.columns where table_name like '<stuff>';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment