Created
February 14, 2015 22:53
-
-
Save rhysallister/af1ff68b37b7060ea4f9 to your computer and use it in GitHub Desktop.
list columns in a table for 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
SELECT attrelid::regclass, attnum, attname | |
FROM pg_attribute | |
WHERE attrelid = 'gn.primaryline'::regclass | |
AND attnum > 0 | |
AND NOT attisdropped | |
ORDER BY attnum; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment