select c.column_name 列名, c.udt_name 数据类型,c.character_maximum_length 长度,c.is_nullable 是否为空, col_description(a.attrelid, a.attnum) as 备注
from pg_attribute as a
left join information_schema.columns as c
on c.table_name = 'lp_query_record' and a.attname = c.column_name
where a.attrelid = (select oid from pg_class where relname = 'lp_query_record')
and a.attnum > 0
and a.atttypid > 0;
【pgSQL】 查看表字段的结构
于 2023-09-28 13:07:31 首次发布