Get all indexes on string columns Postgres
How do I get all indexes that would need reindexing after glibc upgrade ?
my current query:
SELECT
n.nspname AS schema,
c.relname AS table,
i.relname AS index,
a.attname AS column,
pg_catalog.format_type(a.atttypid, a.atttypmod) AS type
FROM pg_index ix
JOIN pg_class i ON i.oid = ix.indexrelid
JOIN pg_class c ON c.oid = ix.indrelid
JOIN pg_namespace n ON n.oid = c.relnamespace
JOIN pg_attribute a ON a.attrelid = c.oid
AND a.attnum = ANY(ix.indkey)
WHERE a.atttypid IN (
'text'::regtype,
'varchar'::regtype,
'bpchar'::regtype
)