|
select
pg_attribute.attname
,replace(pg_type.typname,'_','') as typename
,pg_attribute.atttypmod-4 as charlen
,pg_attribute.atttypid
,pg_attribute.attnum
from
pg_class
inner join pg_attribute
on pg_class.relfilenode = pg_attribute.attrelid
inner join pg_type
on pg_attribute.atttypid = pg_type.typelem
where pg_class.relname = 'テーブル名'
and pg_attribute.attnum > 0
order by pg_attribute.attnum
| |