Skip to content

Instantly share code, notes, and snippets.

@rbuels
Created October 15, 2009 19:27
Show Gist options
  • Select an option

  • Save rbuels/211202 to your computer and use it in GitHub Desktop.

Select an option

Save rbuels/211202 to your computer and use it in GitHub Desktop.
SELECT a.*
FROM pg_catalog.pg_class c
JOIN pg_catalog.pg_attribute a ON a.attrelid = c.oid
WHERE
a.attnum > 0
AND c.relname = 'feature'
AND a.attname = 'feature_id'
AND NOT a.attisdropped
AND pg_catalog.pg_table_is_visible(c.oid);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment