Original query:

select pgc.relname, pgn.nspname from pg_class pgc, pg_namespace pgn where pgc.relnamespace = pgn.oid and pgc.relname like 'idx%' and (pgn.nspname ilike '%repack%' or pgn.nspname ilike '%public%') and pgc.oid in (SELECT indexrelid FROM pg_index WHERE indisvalid = 'f');