]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
pg_upgrade: remove pre-8.4 code and >= 8.4 check
authorBruce Momjian <bruce@momjian.us>
Tue, 6 Oct 2020 18:31:21 +0000 (14:31 -0400)
committerBruce Momjian <bruce@momjian.us>
Tue, 6 Oct 2020 18:31:21 +0000 (14:31 -0400)
We only support upgrading from >= 8.4 so no need for this code or tests.

Reported-by: Magnus Hagander
Discussion: https://postgr.es/m/CABUevEx-D0PNVe00tkeQRGennZQwDtBJn=493MJt-x6sppbUxA@mail.gmail.com

Backpatch-through: 9.5

src/bin/pg_upgrade/check.c
src/bin/pg_upgrade/relfilenode.c

index 3f85f190b568048ab0ec0df4e2f6dc2c52beeb13..054beab0731f7c0c3c76575993bc2897c17adab7 100644 (file)
@@ -227,18 +227,10 @@ void
 output_completion_banner(char *analyze_script_file_name,
                                                 char *deletion_script_file_name)
 {
-       /* Did we copy the free space files? */
-       if (GET_MAJOR_VERSION(old_cluster.major_version) >= 804)
-               pg_log(PG_REPORT,
-                          "Optimizer statistics are not transferred by pg_upgrade so,\n"
-                          "once you start the new server, consider running:\n"
-                          "    %s\n\n", analyze_script_file_name);
-       else
-               pg_log(PG_REPORT,
-                          "Optimizer statistics and free space information are not transferred\n"
-                          "by pg_upgrade so, once you start the new server, consider running:\n"
-                          "    %s\n\n", analyze_script_file_name);
-
+       pg_log(PG_REPORT,
+                  "Optimizer statistics are not transferred by pg_upgrade so,\n"
+                  "once you start the new server, consider running:\n"
+                  "    %s\n\n", analyze_script_file_name);
 
        if (deletion_script_file_name)
                pg_log(PG_REPORT,
@@ -268,7 +260,7 @@ check_cluster_versions(void)
         * upgrades
         */
 
-       if (GET_MAJOR_VERSION(old_cluster.major_version) <= 803)
+       if (GET_MAJOR_VERSION(old_cluster.major_version) < 804)
                pg_fatal("This utility can only upgrade from PostgreSQL version 8.4 and later.\n");
 
        /* Only current PG version is supported as a target */
@@ -503,19 +495,12 @@ create_script_for_cluster_analyze(char **analyze_script_file_name)
                        ECHO_QUOTE, ECHO_QUOTE);
        fprintf(script, "echo %sthis script and run:%s\n",
                        ECHO_QUOTE, ECHO_QUOTE);
-       fprintf(script, "echo %s    \"%s/vacuumdb\" %s--all %s%s\n", ECHO_QUOTE,
-                       new_cluster.bindir, user_specification.data,
-       /* Did we copy the free space files? */
-                       (GET_MAJOR_VERSION(old_cluster.major_version) >= 804) ?
-                       "--analyze-only" : "--analyze", ECHO_QUOTE);
+       fprintf(script, "echo %s    \"%s/vacuumdb\" %s--all --analyze-only%s\n", ECHO_QUOTE,
+                       new_cluster.bindir, user_specification.data, ECHO_QUOTE);
        fprintf(script, "echo%s\n\n", ECHO_BLANK);
 
        fprintf(script, "\"%s/vacuumdb\" %s--all --analyze-in-stages\n",
                        new_cluster.bindir, user_specification.data);
-       /* Did we copy the free space files? */
-       if (GET_MAJOR_VERSION(old_cluster.major_version) <= 803)
-               fprintf(script, "\"%s/vacuumdb\" %s--all\n", new_cluster.bindir,
-                               user_specification.data);
 
        fprintf(script, "echo%s\n\n", ECHO_BLANK);
        fprintf(script, "echo %sDone%s\n",
index 0c78073f0eb08b8efc0916920a681ced0bc7e7f0..0f9c5ca34a5984788258b76e4506f6a73984568e 100644 (file)
@@ -168,16 +168,12 @@ transfer_single_new_db(FileNameMap *maps, int size, char *old_tablespace)
                        /* transfer primary file */
                        transfer_relfile(&maps[mapnum], "", vm_must_add_frozenbit);
 
-                       /* fsm/vm files added in PG 8.4 */
-                       if (GET_MAJOR_VERSION(old_cluster.major_version) >= 804)
-                       {
-                               /*
-                                * Copy/link any fsm and vm files, if they exist
-                                */
-                               transfer_relfile(&maps[mapnum], "_fsm", vm_must_add_frozenbit);
-                               if (vm_crashsafe_match)
-                                       transfer_relfile(&maps[mapnum], "_vm", vm_must_add_frozenbit);
-                       }
+                       /*
+                        * Copy/link any fsm and vm files, if they exist
+                        */
+                       transfer_relfile(&maps[mapnum], "_fsm", vm_must_add_frozenbit);
+                       if (vm_crashsafe_match)
+                               transfer_relfile(&maps[mapnum], "_vm", vm_must_add_frozenbit);
                }
        }
 }