欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

PostgreSQL的常用语句分享

程序员文章站 2022-03-23 19:37:08
postgresql的常用语句分享 --查询出t_test表的relowner select c.relname,c.relowner,a.rolname from pg_class c,...

postgresql的常用语句分享

--查询出t_test表的relowner
select c.relname,c.relowner,a.rolname 
from pg_class c,pg_authid a where c.relowner=a.oid and c.relname='t_test';

--查询出某个索引的索引类型:
select c.relname,a.amname from pg_class c, pg_am a
where c.relam=a.oid and c.relname='tab_lei_1_c2_idx'

--查询出pg索引的类型:
select oid ,* from pg_am