【gp】取gp数据库某表的字段名、注释和排序号

【SQL】

select 
    attname as name,
    attnum as orderNum,
    col_description(attrelid,attnum) as remark
from pg_attribute
where attrelid='your table'::regclass and attnum>0
order by attnum asc

END

 

posted @ 2022-08-19 05:25  不朽的飞翔  阅读(98)  评论(0编辑  收藏  举报