]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Refuse upgrades from pre-9.0 clusters
authorDaniel Gustafsson <dgustafsson@postgresql.org>
Fri, 17 May 2024 12:24:27 +0000 (14:24 +0200)
committerDaniel Gustafsson <dgustafsson@postgresql.org>
Fri, 17 May 2024 12:24:27 +0000 (14:24 +0200)
Commit 695b4a113ab added a dependency on retrieving oldestxid from
pg_control, which only exists in 9.0 and onwards, but the check for
8.4 as the oldest version was retained. Since there has been few if
any complaints of 8.4 upgrades not working, fix by setting 9.0 as
the oldest version supported rather than resurrecting 8.4 support.

Backpatch to all supported versions.

Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/1973418.1657040382@sss.pgh.pa.us
Backpatch-through: v12

doc/src/sgml/ref/pgupgrade.sgml
src/bin/pg_upgrade/check.c

index e2f51fb7bd65abf3ad0ae2fbc77c226b9272c04b..03ebdbd2201f4f45edd26e9a385cd31f31c8da70 100644 (file)
@@ -68,7 +68,7 @@ PostgreSQL documentation
  </para>
 
   <para>
-   pg_upgrade supports upgrades from 8.4.X and later to the current
+   pg_upgrade supports upgrades from 9.0.X and later to the current
    major release of <productname>PostgreSQL</productname>, including snapshot and beta releases.
   </para>
  </refsect1>
index 6e5dc6b1bee4a84955ca9f846a72e4308a5c7152..1fd77f161532f5e33d27d6b7eb546ce035c9aae5 100644 (file)
@@ -280,8 +280,13 @@ check_cluster_versions(void)
         * upgrades
         */
 
-       if (GET_MAJOR_VERSION(old_cluster.major_version) < 804)
-               pg_fatal("This utility can only upgrade from PostgreSQL version 8.4 and later.\n");
+       /*
+        * The minimum version supported when this code shipped in a major version
+        * was 8.4. This has since been raised to 9.0, but the support code for
+        * dealing with 8.4 remains to avoid refactoring in a backbranch.
+        */
+       if (GET_MAJOR_VERSION(old_cluster.major_version) < 900)
+               pg_fatal("This utility can only upgrade from PostgreSQL version 9.0 and later.\n");
 
        /* Only current PG version is supported as a target */
        if (GET_MAJOR_VERSION(new_cluster.major_version) != GET_MAJOR_VERSION(PG_VERSION_NUM))