取某个表的索引明细

前端之家收集整理的这篇文章主要介绍了取某个表的索引明细前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

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;

原文链接:https://www.f2er.com/postgresql/194856.html

猜你在找的Postgre SQL相关文章