diff options
| author | Bruce Momjian | 2010-05-19 18:56:47 +0000 |
|---|---|---|
| committer | Bruce Momjian | 2010-05-19 18:56:47 +0000 |
| commit | 3245bd524034911a0013388db23a86c0093a7d97 (patch) | |
| tree | 40f68f3abeb819b39538b49e4994d4ccc0a76f72 /contrib | |
| parent | 573e446f6f5963a0edad575130743eb75887d087 (diff) | |
Simplify pg_upgrade queries by using IN instead of multiple OR clauses
comparing the same column to multiple values.
Diffstat (limited to 'contrib')
| -rw-r--r-- | contrib/pg_upgrade/info.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/contrib/pg_upgrade/info.c b/contrib/pg_upgrade/info.c index 4fcaeb22d4..756e8ffd85 100644 --- a/contrib/pg_upgrade/info.c +++ b/contrib/pg_upgrade/info.c @@ -327,11 +327,9 @@ get_rel_infos(migratorContext *ctx, const DbInfo *dbinfo, " AND c.oid >= %u " " ) OR ( " " n.nspname = 'pg_catalog' " - " AND (relname = 'pg_largeobject' OR " - " relname = 'pg_largeobject_loid_pn_index') )) " - " AND " - " (relkind = 'r' OR relkind = 't' OR " - " relkind = 'i'%s)" + " AND relname IN " + " ('pg_largeobject', 'pg_largeobject_loid_pn_index') )) " + " AND relkind IN ('r','t', 'i'%s)" "GROUP BY c.oid, n.nspname, c.relname, c.relfilenode," " c.reltoastrelid, t.spclocation, " " n.nspname " @@ -339,7 +337,7 @@ get_rel_infos(migratorContext *ctx, const DbInfo *dbinfo, FirstNormalObjectId, /* see the comment at the top of old_8_3_create_sequence_script() */ (GET_MAJOR_VERSION(ctx->old.major_version) <= 803) ? - "" : " OR relkind = 'S'"); + "" : ", 'S'"); res = executeQueryOrDie(ctx, conn, query); |
