Advertisement
IT-Academy

Select index 1

Dec 14th, 2017
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT i.relname as indname,
  2.        i.relowner as indowner,
  3.        idx.indrelid::regclass,
  4.        am.amname as indam,
  5.        idx.indkey,
  6.        ARRAY(
  7.        SELECT pg_get_indexdef(idx.indexrelid, k + 1, true)
  8.        FROM generate_subscripts(idx.indkey, 1) as k
  9.        ORDER BY k
  10.        ) as indkey_names,
  11.        idx.indexprs IS NOT NULL as indexprs,
  12.        idx.indpred IS NOT NULL as indpred
  13. FROM   pg_index as idx
  14. JOIN   pg_class as i
  15. ON     i.oid = idx.indexrelid
  16. JOIN   pg_am as am
  17. ON     i.relam = am.oid;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement