@@ -59,7 +59,8 @@ old_8_3_check_for_name_data_type_usage(ClusterInfo *cluster)
59
59
"NOT a.attisdropped AND "
60
60
"a.atttypid = 'pg_catalog.name'::pg_catalog.regtype AND "
61
61
"c.relnamespace = n.oid AND "
62
- "n.nspname != 'pg_catalog' AND "
62
+ /* exclude pg_catalog and pg_temp_ (could be orphaned tables) */
63
+ " n.nspname !~ '^pg_' AND "
63
64
"n.nspname != 'information_schema'" );
64
65
65
66
ntups = PQntuples (res );
@@ -148,7 +149,8 @@ old_8_3_check_for_tsquery_usage(ClusterInfo *cluster)
148
149
"NOT a.attisdropped AND "
149
150
"a.atttypid = 'pg_catalog.tsquery'::pg_catalog.regtype AND "
150
151
"c.relnamespace = n.oid AND "
151
- "n.nspname != 'pg_catalog' AND "
152
+ /* exclude pg_catalog and pg_temp_ (could be orphaned tables) */
153
+ " n.nspname !~ '^pg_' AND "
152
154
"n.nspname != 'information_schema'" );
153
155
154
156
ntups = PQntuples (res );
@@ -245,7 +247,8 @@ old_8_3_rebuild_tsvector_tables(ClusterInfo *cluster, bool check_mode)
245
247
"NOT a.attisdropped AND "
246
248
"a.atttypid = 'pg_catalog.tsvector'::pg_catalog.regtype AND "
247
249
"c.relnamespace = n.oid AND "
248
- "n.nspname != 'pg_catalog' AND "
250
+ /* exclude pg_catalog and pg_temp_ (could be orphaned tables) */
251
+ " n.nspname !~ '^pg_' AND "
249
252
"n.nspname != 'information_schema'" );
250
253
251
254
/*
@@ -263,7 +266,7 @@ old_8_3_rebuild_tsvector_tables(ClusterInfo *cluster, bool check_mode)
263
266
"NOT a.attisdropped AND "\
264
267
"a.atttypid = 'pg_catalog.tsvector'::pg_catalog.regtype AND " \
265
268
"c.relnamespace = n.oid AND "\
266
- " n.nspname != 'pg_catalog ' AND " \
269
+ " n.nspname !~ '^pg_ ' AND " \
267
270
"n.nspname != 'information_schema') "
268
271
269
272
ntups = PQntuples (res );
@@ -616,7 +619,8 @@ old_8_3_create_sequence_script(ClusterInfo *cluster)
616
619
"pg_catalog.pg_namespace n "
617
620
"WHEREc.relkind = 'S' AND "
618
621
"c.relnamespace = n.oid AND "
619
- "n.nspname != 'pg_catalog' AND "
622
+ /* exclude pg_catalog and pg_temp_ (could be orphaned tables) */
623
+ " n.nspname !~ '^pg_' AND "
620
624
"n.nspname != 'information_schema'" );
621
625
622
626
ntups = PQntuples (res );