" LEFT OUTER JOIN pg_catalog.pg_tablespace t "
" ON c.reltablespace = t.oid "
"WHERE relkind IN ('r','t', 'i'%s) AND "
- " ((n.nspname NOT IN ('pg_catalog', 'information_schema', 'binary_upgrade') AND "
+ /* exclude pg_catalog and pg_temp_ (could be orphaned tables) */
+ " ((n.nspname !~ '^pg_' AND "
+ " n.nspname NOT IN ('information_schema', 'binary_upgrade') AND "
" c.oid >= %u) "
" OR (n.nspname = 'pg_catalog' AND "
" relname IN ('pg_largeobject', 'pg_largeobject_loid_pn_index'%s) )) "
" NOT a.attisdropped AND "
" a.atttypid = 'pg_catalog.name'::pg_catalog.regtype AND "
" c.relnamespace = n.oid AND "
- " n.nspname != 'pg_catalog' AND "
+ /* exclude pg_catalog and pg_temp_ (could be orphaned tables) */
+ " n.nspname !~ '^pg_' AND "
" n.nspname != 'information_schema'");
ntups = PQntuples(res);
" NOT a.attisdropped AND "
" a.atttypid = 'pg_catalog.tsquery'::pg_catalog.regtype AND "
" c.relnamespace = n.oid AND "
- " n.nspname != 'pg_catalog' AND "
+ /* exclude pg_catalog and pg_temp_ (could be orphaned tables) */
+ " n.nspname !~ '^pg_' AND "
" n.nspname != 'information_schema'");
ntups = PQntuples(res);
" NOT a.attisdropped AND "
" a.atttypid = 'pg_catalog.tsvector'::pg_catalog.regtype AND "
" c.relnamespace = n.oid AND "
- " n.nspname != 'pg_catalog' AND "
+ /* exclude pg_catalog and pg_temp_ (could be orphaned tables) */
+ " n.nspname !~ '^pg_' AND "
" n.nspname != 'information_schema'");
/*
" NOT a.attisdropped AND " \
" a.atttypid = 'pg_catalog.tsvector'::pg_catalog.regtype AND " \
" c.relnamespace = n.oid AND " \
- " n.nspname != 'pg_catalog' AND " \
+ " n.nspname !~ '^pg_' AND " \
" n.nspname != 'information_schema') "
ntups = PQntuples(res);
" pg_catalog.pg_namespace n "
"WHERE c.relkind = 'S' AND "
" c.relnamespace = n.oid AND "
- " n.nspname != 'pg_catalog' AND "
+ /* exclude pg_catalog and pg_temp_ (could be orphaned tables) */
+ " n.nspname !~ '^pg_' AND "
" n.nspname != 'information_schema'");
ntups = PQntuples(res);