Skip to content

Instantly share code, notes, and snippets.

@jonmathews
Created July 15, 2020 07:13
Show Gist options
  • Save jonmathews/1f0572178b8c538f055734fbb1b9dfbb to your computer and use it in GitHub Desktop.
Save jonmathews/1f0572178b8c538f055734fbb1b9dfbb to your computer and use it in GitHub Desktop.
Get column metadata from Postgres
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment