Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit96a770d

Browse files
committed
In pg_upgrade, avoid dumping orphaned temporary tables. This makes the
pg_upgrade schema matching pattern match pg_dump/pg_dumpall.Fix for 9.0, 9.1, and 9.2.
1 parentb0313dd commit96a770d

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

‎contrib/pg_upgrade/info.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,9 @@ get_rel_infos(ClusterInfo *cluster, DbInfo *dbinfo)
266266
" LEFT OUTER JOIN pg_catalog.pg_tablespace t "
267267
" ON c.reltablespace = t.oid "
268268
"WHERE relkind IN ('r','t', 'i'%s) AND "
269-
" ((n.nspname NOT IN ('pg_catalog', 'information_schema', 'binary_upgrade') AND "
269+
/* exclude pg_catalog and pg_temp_ (could be orphaned tables) */
270+
" ((n.nspname !~ '^pg_' AND "
271+
" n.nspname NOT IN ('information_schema', 'binary_upgrade') AND "
270272
" c.oid >= %u) "
271273
" OR (n.nspname = 'pg_catalog' AND "
272274
" relname IN ('pg_largeobject', 'pg_largeobject_loid_pn_index'%s) )) "

‎contrib/pg_upgrade/version_old_8_3.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ old_8_3_check_for_name_data_type_usage(ClusterInfo *cluster)
5959
"NOT a.attisdropped AND "
6060
"a.atttypid = 'pg_catalog.name'::pg_catalog.regtype AND "
6161
"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 "
6364
"n.nspname != 'information_schema'");
6465

6566
ntups=PQntuples(res);
@@ -149,7 +150,8 @@ old_8_3_check_for_tsquery_usage(ClusterInfo *cluster)
149150
"NOT a.attisdropped AND "
150151
"a.atttypid = 'pg_catalog.tsquery'::pg_catalog.regtype AND "
151152
"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 "
153155
"n.nspname != 'information_schema'");
154156

155157
ntups=PQntuples(res);
@@ -247,7 +249,8 @@ old_8_3_rebuild_tsvector_tables(ClusterInfo *cluster, bool check_mode)
247249
"NOT a.attisdropped AND "
248250
"a.atttypid = 'pg_catalog.tsvector'::pg_catalog.regtype AND "
249251
"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 "
251254
"n.nspname != 'information_schema'");
252255

253256
/*
@@ -265,7 +268,7 @@ old_8_3_rebuild_tsvector_tables(ClusterInfo *cluster, bool check_mode)
265268
"NOT a.attisdropped AND "\
266269
"a.atttypid = 'pg_catalog.tsvector'::pg_catalog.regtype AND " \
267270
"c.relnamespace = n.oid AND "\
268-
"n.nspname != 'pg_catalog' AND "\
271+
"n.nspname !~ '^pg_' AND "\
269272
"n.nspname != 'information_schema') "
270273

271274
ntups=PQntuples(res);
@@ -631,7 +634,8 @@ old_8_3_create_sequence_script(ClusterInfo *cluster)
631634
"pg_catalog.pg_namespace n "
632635
"WHEREc.relkind = 'S' AND "
633636
"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 "
635639
"n.nspname != 'information_schema'");
636640

637641
ntups=PQntuples(res);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp