查找AnalyticDB表的DDL语句
select dump_talbe_ddl('tablename'::regclass);
1.获取AnalyticDB表
select * from information_schema.tables;
2.获取AnalyticDB列
select * from information_schema.columns;
3.获取ADB PG表中文名
获取表中文名:方法一
select t.schemaname
,t.relname --表英文名
,description --表中文名
from pg_description d
,pg_class c
,pg_stat_all_tables t
where d.objoid = c.oid
and objsubid = 0
and t.relname = c.relname
and t.schemaname = 'SCHEMANAME'
and c.relname = 'tablename'
;
获取表中文名:方法二
select relname --表英文名
,obj_description(c.oid) --表中文名
from pg_class c
where obj_description(c.oid) is not null
and relname = 'tablename'
;
获取表中文名:方法三
select distinct a.relname --表英文名
,b.description --表中文名
from pg_class a
left join pg_description b
on a.oid = b.objoid
and b.objsubid = '0'
where a.relname = 'tablename'
;
4.获取表中文名、字段中文名、字段类型
select
--t2.attnum,
t2.relname --表英文名
,obj_description(t2.oid) --表中文名
,t2.field --字段英文名
,t2.

本文提供了一套全面的AnalyticDB PostgreSQL表信息查询方法,包括DDL语句获取、表及列基本信息查询、表中文名获取、表字段中文名及类型查询等,并介绍了如何处理死锁进程及锁定表的问题。
最低0.47元/天 解锁文章
374

被折叠的 条评论
为什么被折叠?



