@@ -61,7 +61,8 @@ old_8_3_check_for_name_data_type_usage(migratorContext *ctx, Cluster whichCluste
61
61
"NOT a.attisdropped AND "
62
62
"a.atttypid = 'pg_catalog.name'::pg_catalog.regtype AND "
63
63
"c.relnamespace = n.oid AND "
64
- "n.nspname != 'pg_catalog' AND "
64
+ /* exclude pg_catalog and pg_temp_ (could be orphaned tables) */
65
+ " n.nspname !~ '^pg_' AND "
65
66
"n.nspname != 'information_schema'" );
66
67
67
68
ntups = PQntuples (res );
@@ -151,7 +152,8 @@ old_8_3_check_for_tsquery_usage(migratorContext *ctx, Cluster whichCluster)
151
152
"NOT a.attisdropped AND "
152
153
"a.atttypid = 'pg_catalog.tsquery'::pg_catalog.regtype AND "
153
154
"c.relnamespace = n.oid AND "
154
- "n.nspname != 'pg_catalog' AND "
155
+ /* exclude pg_catalog and pg_temp_ (could be orphaned tables) */
156
+ " n.nspname !~ '^pg_' AND "
155
157
"n.nspname != 'information_schema'" );
156
158
157
159
ntups = PQntuples (res );
@@ -250,7 +252,8 @@ old_8_3_rebuild_tsvector_tables(migratorContext *ctx, bool check_mode,
250
252
"NOT a.attisdropped AND "
251
253
"a.atttypid = 'pg_catalog.tsvector'::pg_catalog.regtype AND "
252
254
"c.relnamespace = n.oid AND "
253
- "n.nspname != 'pg_catalog' AND "
255
+ /* exclude pg_catalog and pg_temp_ (could be orphaned tables) */
256
+ " n.nspname !~ '^pg_' AND "
254
257
"n.nspname != 'information_schema'" );
255
258
256
259
/*
@@ -268,7 +271,7 @@ old_8_3_rebuild_tsvector_tables(migratorContext *ctx, bool check_mode,
268
271
"NOT a.attisdropped AND "\
269
272
"a.atttypid = 'pg_catalog.tsvector'::pg_catalog.regtype AND " \
270
273
"c.relnamespace = n.oid AND "\
271
- " n.nspname != 'pg_catalog ' AND " \
274
+ " n.nspname !~ '^pg_ ' AND " \
272
275
"n.nspname != 'information_schema') "
273
276
274
277
ntups = PQntuples (res );
@@ -638,7 +641,8 @@ old_8_3_create_sequence_script(migratorContext *ctx, Cluster whichCluster)
638
641
"pg_catalog.pg_namespace n "
639
642
"WHEREc.relkind = 'S' AND "
640
643
"c.relnamespace = n.oid AND "
641
- "n.nspname != 'pg_catalog' AND "
644
+ /* exclude pg_catalog and pg_temp_ (could be orphaned tables) */
645
+ " n.nspname !~ '^pg_' AND "
642
646
"n.nspname != 'information_schema'" );
643
647
644
648
ntups = PQntuples (res );