Created
March 2, 2013 13:31
-
-
Save letitride/5070978 to your computer and use it in GitHub Desktop.
my tables infomation
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 | |
a.attname, | |
ty.typname, | |
a.atttypid, | |
a.atthasdef, | |
a.attnotnull, | |
a.attisdropped, | |
d.description | |
from | |
pg_stat_user_tables t | |
join pg_attribute a on | |
t.relid = a.attrelid | |
join pg_type ty on | |
a.atttypid = ty.oid | |
left join pg_description d on | |
a.attrelid = d.objoid and a.attnum = d.objsubid | |
where | |
a.attisdropped = false | |
and a.attnum > 0 | |
order by a.attnum; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment