@@ -59,9 +59,10 @@ 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
- /* exclude pg_catalog and pg_temp_ (could be orphaned tables) */
63
- " n.nspname !~ '^pg_' AND "
64
- " n.nspname != 'information_schema'" );
62
+ /* exclude possible orphaned temp tables */
63
+ " n.nspname !~ '^pg_temp_' AND "
64
+ " n.nspname !~ '^pg_toast_temp_' AND "
65
+ " n.nspname NOT IN ('pg_catalog', 'information_schema')" );
65
66
66
67
ntups = PQntuples (res );
67
68
i_nspname = PQfnumber (res , "nspname" );
@@ -149,9 +150,10 @@ old_8_3_check_for_tsquery_usage(ClusterInfo *cluster)
149
150
" NOT a.attisdropped AND "
150
151
" a.atttypid = 'pg_catalog.tsquery'::pg_catalog.regtype AND "
151
152
" c.relnamespace = n.oid AND "
152
- /* exclude pg_catalog and pg_temp_ (could be orphaned tables) */
153
- " n.nspname !~ '^pg_' AND "
154
- " n.nspname != 'information_schema'" );
153
+ /* exclude possible orphaned temp tables */
154
+ " n.nspname !~ '^pg_temp_' AND "
155
+ " n.nspname !~ '^pg_toast_temp_' AND "
156
+ " n.nspname NOT IN ('pg_catalog', 'information_schema')" );
155
157
156
158
ntups = PQntuples (res );
157
159
i_nspname = PQfnumber (res , "nspname" );
@@ -247,9 +249,10 @@ old_8_3_rebuild_tsvector_tables(ClusterInfo *cluster, bool check_mode)
247
249
" NOT a.attisdropped AND "
248
250
" a.atttypid = 'pg_catalog.tsvector'::pg_catalog.regtype AND "
249
251
" c.relnamespace = n.oid AND "
250
- /* exclude pg_catalog and pg_temp_ (could be orphaned tables) */
251
- " n.nspname !~ '^pg_' AND "
252
- " n.nspname != 'information_schema'" );
252
+ /* exclude possible orphaned temp tables */
253
+ " n.nspname !~ '^pg_temp_' AND "
254
+ " n.nspname !~ '^pg_toast_temp_' AND "
255
+ " n.nspname NOT IN ('pg_catalog', 'information_schema')" );
253
256
254
257
/*
255
258
* This macro is used below to avoid reindexing indexes already rebuilt
@@ -619,9 +622,10 @@ old_8_3_create_sequence_script(ClusterInfo *cluster)
619
622
" pg_catalog.pg_namespace n "
620
623
"WHERE c.relkind = 'S' AND "
621
624
" c.relnamespace = n.oid AND "
622
- /* exclude pg_catalog and pg_temp_ (could be orphaned tables) */
623
- " n.nspname !~ '^pg_' AND "
624
- " n.nspname != 'information_schema'" );
625
+ /* exclude possible orphaned temp tables */
626
+ " n.nspname !~ '^pg_temp_' AND "
627
+ " n.nspname !~ '^pg_toast_temp_' AND "
628
+ " n.nspname NOT IN ('pg_catalog', 'information_schema')" );
625
629
626
630
ntups = PQntuples (res );
627
631
i_nspname = PQfnumber (res , "nspname" );
0 commit comments