Use the catversion to distinguish old/new clusters
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Thu, 24 Jan 2013 15:25:48 +0000 (12:25 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Thu, 24 Jan 2013 15:36:18 +0000 (12:36 -0300)
This makes 9.3 -> 9.3 upgrades work when they cross the commit that
added persistent multixacts; early 9.3 pg_controldata did not have the
required oldestMultiXact line, and so would fail to upgrade.

per Bruce Momjian

contrib/pg_upgrade/controldata.c

index 2ea0ce442d13fd58b9db4d5ef0a7ea3acd4c62fb..01c66776e44fab9b02dd7b5b27fb5e1603ba6000 100644 (file)
@@ -470,7 +470,7 @@ get_control_data(ClusterInfo *cluster, bool live_check)
    /* verify that we got all the mandatory pg_control data */
    if (!got_xid || !got_oid ||
        !got_multi || !got_mxoff ||
-       (!got_oldestmulti && GET_MAJOR_VERSION(cluster->major_version) >= 903) ||
+       (!got_oldestmulti && cluster->controldata.cat_ver >= MULTIXACT_FORMATCHANGE_CAT_VER) ||
        (!live_check && !got_nextxlogfile) ||
        !got_tli ||
        !got_align || !got_blocksz || !got_largesz || !got_walsz ||
@@ -493,7 +493,7 @@ get_control_data(ClusterInfo *cluster, bool live_check)
        if (!got_mxoff)
            pg_log(PG_REPORT, "  latest checkpoint next MultiXactOffset\n");
 
-       if (!got_oldestmulti && GET_MAJOR_VERSION(cluster->major_version) >= 903)
+       if (!got_oldestmulti && cluster->controldata.cat_ver >= MULTIXACT_FORMATCHANGE_CAT_VER)
            pg_log(PG_REPORT, "  latest checkpoint oldest MultiXactId\n");
 
        if (!live_check && !got_nextxlogfile)