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

Commite69d321

Browse files
committed
Simplify structure of query used to gather database object information
in pg_upgrade.
1 parentd8d4298 commite69d321

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

‎contrib/pg_upgrade/info.c

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -255,27 +255,25 @@ get_rel_infos(ClusterInfo *cluster, DbInfo *dbinfo)
255255
snprintf(query,sizeof(query),
256256
"SELECT c.oid, n.nspname, c.relname, "
257257
"c.relfilenode, t.spclocation "
258-
"FROM pg_catalog.pg_class c JOIN "
259-
"pg_catalog.pg_namespace n "
260-
"ON c.relnamespace = n.oid "
261-
" LEFT OUTER JOIN pg_catalog.pg_tablespace t "
262-
"ON c.reltablespace = t.oid "
263-
"WHERE (( n.nspname NOT IN ('pg_catalog', 'information_schema', 'binary_upgrade') "
264-
"AND c.oid >= %u "
265-
") OR ( "
266-
"n.nspname = 'pg_catalog' "
267-
"AND relname IN "
268-
" ('pg_largeobject', 'pg_largeobject_loid_pn_index'%s) )) "
269-
"AND relkind IN ('r','t', 'i'%s) "
258+
"FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n "
259+
" ON c.relnamespace = n.oid "
260+
" LEFT OUTER JOIN pg_catalog.pg_tablespace t "
261+
" ON c.reltablespace = t.oid "
262+
"WHERE relkind IN ('r','t', 'i'%s) AND "
263+
" ((n.nspname NOT IN ('pg_catalog', 'information_schema', 'binary_upgrade') AND "
264+
" c.oid >= %u) "
265+
" OR (n.nspname = 'pg_catalog' AND "
266+
" relname IN ('pg_largeobject', 'pg_largeobject_loid_pn_index'%s) )) "
270267
/* we preserve pg_class.oid so we sort by it to match old/new */
271268
"ORDER BY 1;",
269+
/* see the comment at the top of old_8_3_create_sequence_script() */
270+
(GET_MAJOR_VERSION(old_cluster.major_version) <=803) ?
271+
"" :", 'S'",
272+
/* this oid allows us to skip system toast tables */
272273
FirstNormalObjectId,
273274
/* does pg_largeobject_metadata need to be migrated? */
274275
(GET_MAJOR_VERSION(old_cluster.major_version) <=804) ?
275-
"" :", 'pg_largeobject_metadata', 'pg_largeobject_metadata_oid_index'",
276-
/* see the comment at the top of old_8_3_create_sequence_script() */
277-
(GET_MAJOR_VERSION(old_cluster.major_version) <=803) ?
278-
"" :", 'S'");
276+
"" :", 'pg_largeobject_metadata', 'pg_largeobject_metadata_oid_index'");
279277

280278
res=executeQueryOrDie(conn,query);
281279

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp