您的位置:首页 > 其它

取某个表的索引明细

2015-11-18 11:32 267 查看
select a.relname as indexname,b.attname as colname from pg_class as a, (select attname,attrelid from pg_attribute where attrelid in (select oid from pg_class where relname in (SELECT c.relname AS index_name FROM (SELECT relname,indexrelid FROM pg_index i, pg_class c WHERE c.relname = 'sku_attributes' AND indrelid = c.oid) t, pg_index i,pg_class c WHERE t.indexrelid = i.indexrelid AND i.indexrelid = c.oid))) as b where a.oid=b.attrelid group by indexname,colname;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: