pg col_description 用法 pg_col_description函数用于获取指定表的指定列的说明文档。 它的语法是: pg_col_description(relation_oid, column_number) 其中,relation_oid是表的对象ID(可使用pg_class类中的relname获取),column_number是要查询的列的索引号。 该函数返回一个字符串,表示所指定列的说明文档。如果未...
pgsql查询表中字段名,类型,备注以及是否非空 SELECT col_description ( A.attrelid, A.attnum ) AS COMMENT, format_type ( A.atttypid, A.atttypmod ) AS TYPE, A.attname AS NAME, A.attnotnull AS NOTNULL FROM pg_class AS C, pg_attribute AS A WHERE C.relname='dm_ass_gp_income'AND ...
a.attname as "字段名", col_description(a.attrelid,a.attnum) as "注释", concat_ws('',t.typname,SUBSTRING(format_type(a.atttypid,a.atttypmod) from '(.*)')) as "字段类型" FROM pg_class as c, pg_attribute as a, pg_type as t WHERE c.relname = 't_batch_task' and a.attt...
(case when a.attnotnull=true then 'Y' else 'N' end) as nullable, col_description(a.attrelid,a.attnum) as comment from pg_attribute a left join pg_class b on a.attrelid = b.oid where attstattarget=-1 and attrelid in (select oid from pg_class where relname in ('component','...
SELECTa.attnameas字段名,format_type(a.atttypid,a.atttypmod)as类型,a.attnotnullas非空,col_description(a.attrelid,a.attnum)as注释FROMpg_classasc,pg_attributeasaWHEREa.attrelid=c.oid and a.attnum>0and c.relname='表名'; 最后编辑于:2023.09.25 10:22:25 ...
col_description(a.attrelid,a.attnum) from pg_attribute a where attstattarget=-1 and attrelid in(select oid from pg_class where relname in (select relname as table_name from pg_class where relkind='r' and relname like 'exg_%' order by relname)) ...
col_description(a.attrelid,a.attnum) ::varchar2 as column_comment FROM pg_class as c,pg_attribute as a where a.attrelid = c.oid and a.attnum>0 and c.relname = tableName; end; $$ language plpgsql; select * from show_table('employees'); create or replace function query_ta...
col_description(a.attrelid,a.attnum) as "注释", concat_ws('',t.typname,SUBSTRING(format_type(a.atttypid,a.atttypmod) from '(.*)')) as "字段类型" FROM pg_class as c, pg_attribute as a, pg_type as t WHERE c.relname = 't_batch_task' ...
cast(obj_description(pg_class.relfilenode,'pg_class') as varchar) as 表中文描述, '' as 表类型, '' as 表创建时间, pg_attribute.attnum as 字段编号, pg_attribute.attname as 字段名, col_description(pg_attribute.attrelid,pg_attribute.attnum) as 字段描述, ...
SELECT pg_catalog.col_description(c.oid, sc.ordinal_position::INT) FROM pg_catalog.pg_class c WHERE c.oid = (SELECT ('"' || sc.table_name || '"')::REGCLASS::OID) AND c.relname = sc.table_name ) AS comment FROM information_schema.columns sc WHERE table_schema = 'public' AND ...