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

Commit3245bd5

Browse files
committed
Simplify pg_upgrade queries by using IN instead of multiple OR clauses
comparing the same column to multiple values.
1 parent573e446 commit3245bd5

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

‎contrib/pg_upgrade/info.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -327,19 +327,17 @@ get_rel_infos(migratorContext *ctx, const DbInfo *dbinfo,
327327
"AND c.oid >= %u "
328328
") OR ( "
329329
"n.nspname = 'pg_catalog' "
330-
"AND (relname = 'pg_largeobject' OR "
331-
" relname = 'pg_largeobject_loid_pn_index') )) "
332-
"AND "
333-
"(relkind = 'r' OR relkind = 't' OR "
334-
" relkind = 'i'%s)"
330+
"AND relname IN "
331+
" ('pg_largeobject', 'pg_largeobject_loid_pn_index') )) "
332+
"AND relkind IN ('r','t', 'i'%s)"
335333
"GROUP BY c.oid, n.nspname, c.relname, c.relfilenode,"
336334
"c.reltoastrelid, t.spclocation, "
337335
"n.nspname "
338336
"ORDER BY n.nspname, c.relname;",
339337
FirstNormalObjectId,
340338
/* see the comment at the top of old_8_3_create_sequence_script() */
341339
(GET_MAJOR_VERSION(ctx->old.major_version) <=803) ?
342-
"" :" OR relkind = 'S'");
340+
"" :", 'S'");
343341

344342
res=executeQueryOrDie(ctx,conn,query);
345343

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp