index column analysingh works for both postgres and cockroach

This commit is contained in:
Jan Prochazka
2021-08-25 18:43:08 +02:00
parent 10e63f3e77
commit b9e2e51bd7
4 changed files with 37 additions and 7 deletions

View File

@@ -5,12 +5,8 @@ module.exports = `
i.relname as "index_name",
ix.indisprimary as "is_primary",
ix.indisunique as "is_unique",
(
select
array_to_string(array_agg((select a.attname from pg_attribute a where ord = a.attnum and a.attrelid = t.oid)), '|')
from
unnest(ix.indkey) ord
) as "column_names"
ix.indkey as "indkey",
t.oid as "oid"
from
pg_class t,
pg_class i,