@@ -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" );
@@ -150,9 +151,10 @@ old_8_3_check_for_tsquery_usage(ClusterInfo *cluster)
150
151
"NOT a.attisdropped AND "
151
152
"a.atttypid = 'pg_catalog.tsquery'::pg_catalog.regtype AND "
152
153
"c.relnamespace = n.oid AND "
153
- /* exclude pg_catalog and pg_temp_ (could be orphaned tables) */
154
- " n.nspname !~ '^pg_' AND "
155
- "n.nspname != 'information_schema'" );
154
+ /* exclude possible orphaned temp tables */
155
+ " n.nspname !~ '^pg_temp_' AND "
156
+ "n.nspname !~ '^pg_toast_temp_' AND "
157
+ "n.nspname NOT IN ('pg_catalog', 'information_schema')" );
156
158
157
159
ntups = PQntuples (res );
158
160
i_nspname = PQfnumber (res ,"nspname" );
@@ -249,9 +251,10 @@ old_8_3_rebuild_tsvector_tables(ClusterInfo *cluster, bool check_mode)
249
251
"NOT a.attisdropped AND "
250
252
"a.atttypid = 'pg_catalog.tsvector'::pg_catalog.regtype AND "
251
253
"c.relnamespace = n.oid AND "
252
- /* exclude pg_catalog and pg_temp_ (could be orphaned tables) */
253
- " n.nspname !~ '^pg_' AND "
254
- "n.nspname != 'information_schema'" );
254
+ /* exclude possible orphaned temp tables */
255
+ " n.nspname !~ '^pg_temp_' AND "
256
+ "n.nspname !~ '^pg_toast_temp_' AND "
257
+ "n.nspname NOT IN ('pg_catalog', 'information_schema')" );
255
258
256
259
/*
257
260
*This macro is used below to avoid reindexing indexes already rebuilt
@@ -634,9 +637,10 @@ old_8_3_create_sequence_script(ClusterInfo *cluster)
634
637
"pg_catalog.pg_namespace n "
635
638
"WHEREc.relkind = 'S' AND "
636
639
"c.relnamespace = n.oid AND "
637
- /* exclude pg_catalog and pg_temp_ (could be orphaned tables) */
638
- " n.nspname !~ '^pg_' AND "
639
- "n.nspname != 'information_schema'" );
640
+ /* exclude possible orphaned temp tables */
641
+ " n.nspname !~ '^pg_temp_' AND "
642
+ "n.nspname !~ '^pg_toast_temp_' AND "
643
+ "n.nspname NOT IN ('pg_catalog', 'information_schema')" );
640
644
641
645
ntups = PQntuples (res );
642
646
i_nspname = PQfnumber (res ,"nspname" );