Closed
Description
We'd like to add support for Indexes in the UI. This is the basic query to get started:
SELECT
c.oid :: int8 as id,
i.relname AS name,
n.nspname AS schema,
c.relname AS table_name,
t.spcname AS tablespace,
pg_get_indexdef(i.oid) AS indexdef
FROM
pg_index x
JOIN pg_class c ON c.oid = x.indrelid
JOIN pg_class i ON i.oid = x.indexrelid
LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
LEFT JOIN pg_tablespace t ON t.oid = i.reltablespace
WHERE (c.relkind = ANY (ARRAY['r'::"char", 'm'::"char", 'p'::"char"])) AND (i.relkind = ANY (ARRAY['i'::"char", 'I'::"char"]));