@@ -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 );
@@ -149,7 +150,8 @@ 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
- " n.nspname != 'pg_catalog' AND "
153
+ /* exclude pg_catalog and pg_temp_ (could be orphaned tables) */
154
+ " n.nspname !~ '^pg_' AND "
153
155
" n.nspname != 'information_schema'" );
154
156
155
157
ntups = PQntuples (res );
@@ -247,7 +249,8 @@ 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
- " n.nspname != 'pg_catalog' AND "
252
+ /* exclude pg_catalog and pg_temp_ (could be orphaned tables) */
253
+ " n.nspname !~ '^pg_' AND "
251
254
" n.nspname != 'information_schema'" );
252
255
253
256
/*
@@ -265,7 +268,7 @@ old_8_3_rebuild_tsvector_tables(ClusterInfo *cluster, bool check_mode)
265
268
" NOT a.attisdropped AND " \
266
269
" a.atttypid = 'pg_catalog.tsvector'::pg_catalog.regtype AND " \
267
270
" c.relnamespace = n.oid AND " \
268
- " n.nspname != 'pg_catalog ' AND " \
271
+ " n.nspname !~ '^pg_ ' AND " \
269
272
" n.nspname != 'information_schema') "
270
273
271
274
ntups = PQntuples (res );
@@ -631,7 +634,8 @@ old_8_3_create_sequence_script(ClusterInfo *cluster)
631
634
" pg_catalog.pg_namespace n "
632
635
"WHERE c.relkind = 'S' AND "
633
636
" c.relnamespace = n.oid AND "
634
- " n.nspname != 'pg_catalog' AND "
637
+ /* exclude pg_catalog and pg_temp_ (could be orphaned tables) */
638
+ " n.nspname !~ '^pg_' AND "
635
639
" n.nspname != 'information_schema'" );
636
640
637
641
ntups = PQntuples (res );
0 commit comments