Thursday, July 18, 2013

Postgresql - select view of each column in table

Select attname
FROM   pg_attribute
WHERE  attrelid = 'tableName'::regclass
AND    attnum  >= 1           -- exclude tableoid & friends (neg. attnum)
AND    attisdropped is FALSE  -- exclude deleted columns

No comments:

Post a Comment