Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

29 lines (24 sloc) 0.814 kb
SELECT
a.attname as "Column",
pg_catalog.format_type(a.atttypid, a.atttypmod) as "Datatype"
FROM
pg_catalog.pg_attribute a
WHERE
a.attnum > 0
AND NOT a.attisdropped
AND a.attrelid = (
SELECT c.oid
FROM pg_catalog.pg_class c
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
WHERE c.relname ~ '^(percells)$'
AND pg_catalog.pg_table_is_visible(c.oid)
)
;
-- or
select a.attname from pg_attribute a, pg_class b
where b.relfilenode=a.attrelid and b.relname='percells'
and a.attname not in ('tableoid','cmax','xmax','cmin','xmin','ctid')
-- or
select attname from pg_attribute
where attrelid = 'percells'::regclass -- 'my_schema.my_tablename'::regclass
and attnum > 0 and not attisdropped;
Jump to Line
Something went wrong with that request. Please try again.