@@ -61,9 +61,11 @@ 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
- /* exclude pg_catalog and pg_temp_ (could be orphaned tables) */
65
- " n.nspname !~ '^pg_' AND "
66
- " n.nspname != 'information_schema'" );
64
+ /* exclude possibly orphaned temp tables */
65
+ " n.nspname != 'pg_catalog' AND "
66
+ " n.nspname !~ '^pg_temp_' AND "
67
+ " n.nspname !~ '^pg_toast_temp_' AND "
68
+ " n.nspname != 'information_schema' " );
67
69
68
70
ntups = PQntuples (res );
69
71
i_nspname = PQfnumber (res , "nspname" );
@@ -152,9 +154,11 @@ old_8_3_check_for_tsquery_usage(migratorContext *ctx, Cluster whichCluster)
152
154
" NOT a.attisdropped AND "
153
155
" a.atttypid = 'pg_catalog.tsquery'::pg_catalog.regtype AND "
154
156
" c.relnamespace = n.oid AND "
155
- /* exclude pg_catalog and pg_temp_ (could be orphaned tables) */
156
- " n.nspname !~ '^pg_' AND "
157
- " n.nspname != 'information_schema'" );
157
+ /* exclude possibly orphaned temp tables */
158
+ " n.nspname != 'pg_catalog' AND "
159
+ " n.nspname !~ '^pg_temp_' AND "
160
+ " n.nspname !~ '^pg_toast_temp_' AND "
161
+ " n.nspname != 'information_schema' " );
158
162
159
163
ntups = PQntuples (res );
160
164
i_nspname = PQfnumber (res , "nspname" );
@@ -252,9 +256,11 @@ old_8_3_rebuild_tsvector_tables(migratorContext *ctx, bool check_mode,
252
256
" NOT a.attisdropped AND "
253
257
" a.atttypid = 'pg_catalog.tsvector'::pg_catalog.regtype AND "
254
258
" c.relnamespace = n.oid AND "
255
- /* exclude pg_catalog and pg_temp_ (could be orphaned tables) */
256
- " n.nspname !~ '^pg_' AND "
257
- " n.nspname != 'information_schema'" );
259
+ /* exclude possibly orphaned temp tables */
260
+ " n.nspname != 'pg_catalog' AND "
261
+ " n.nspname !~ '^pg_temp_' AND "
262
+ " n.nspname !~ '^pg_toast_temp_' AND "
263
+ " n.nspname != 'information_schema' " );
258
264
259
265
/*
260
266
* This macro is used below to avoid reindexing indexes already rebuilt
@@ -271,8 +277,10 @@ old_8_3_rebuild_tsvector_tables(migratorContext *ctx, bool check_mode,
271
277
" NOT a.attisdropped AND " \
272
278
" a.atttypid = 'pg_catalog.tsvector'::pg_catalog.regtype AND " \
273
279
" c.relnamespace = n.oid AND " \
274
- " n.nspname !~ '^pg_' AND " \
275
- " n.nspname != 'information_schema') "
280
+ " n.nspname != 'pg_catalog' AND " \
281
+ " n.nspname !~ '^pg_temp_' AND " \
282
+ " n.nspname !~ '^pg_toast_temp_' AND " \
283
+ " n.nspname != 'information_schema')"
276
284
277
285
ntups = PQntuples (res );
278
286
i_nspname = PQfnumber (res , "nspname" );
@@ -641,9 +649,12 @@ old_8_3_create_sequence_script(migratorContext *ctx, Cluster whichCluster)
641
649
" pg_catalog.pg_namespace n "
642
650
"WHERE c.relkind = 'S' AND "
643
651
" c.relnamespace = n.oid AND "
644
- /* exclude pg_catalog and pg_temp_ (could be orphaned tables) */
645
- " n.nspname !~ '^pg_' AND "
646
- " n.nspname != 'information_schema'" );
652
+ /* exclude possibly orphaned temp tables */
653
+ " n.nspname != 'pg_catalog' AND "
654
+ " n.nspname !~ '^pg_temp_' AND "
655
+ " n.nspname !~ '^pg_toast_temp_' AND "
656
+ " n.nspname != 'information_schema' " );
657
+
647
658
648
659
ntups = PQntuples (res );
649
660
i_nspname = PQfnumber (res , "nspname" );
0 commit comments