Created
May 24, 2014 07:39
-
-
Save 00krishna/9687ad5a4d1aeaaa9013 to your computer and use it in GitHub Desktop.
select all columns in a table
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 = 'myschema.mytable'::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