Hi all,
I trying to extract the metadata from a view and getting spotty results.
Using the following:
SELECT a.attnum, a.attname, t.typname, a.attlen, a.atttypmod, a.attnotnull,
a.atthasdef FROM pg_class as c, pg_attribute a, pg_type t WHERE a.attnum >
0 and a.attrelid = c.oid and c.relname = 'users' and a.atttypid = t.oid
order by a.attnum
I get correct results on a table for a.attnum, a.attname, t.typname,
a.attlen, a.atttypmod, a.attnotnull and a.atthasdef, but for a view
a.attnotnull and a.atthasdef return nothing.
Any clues anyone?