PostgreSQL table attribute

PostgreSQLでカラム属性を見たいときは、つぎのようにすれば良い。ただし、table_nameは対象となるテーブルの名前。

select attname, atttypid, attlen
from pg_attribute
where attnum > 0
and attrelid = (select relfilenode from pg_class where relname = ‘table_name’)
order by attnum;
同じカテゴリの記事: Linux