8000 pg_upgrade: remove pre-8.4 code and >= 8.4 check · postgrespro/postgres@0691797 · GitHub
[go: up one dir, main page]

Skip to content
  • Commit 0691797

    Browse files
    committed
    pg_upgrade: remove pre-8.4 code and >= 8.4 check
    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
    1 parent bc1fbc9 commit 0691797

    File tree

    2 files changed

    +13
    -32
    lines changed

    2 files changed

    +13
    -32
    lines changed

    src/bin/pg_upgrade/check.c

    Lines changed: 7 additions & 22 deletions
    Original file line numberDiff line numberDiff line change
    @@ -234,18 +234,10 @@ void
    234234
    output_completion_banner(char *analyze_script_file_name,
    235235
    char *deletion_script_file_name)
    236236
    {
    237-
    /* Did we copy the free space files? */
    238-
    if (GET_MAJOR_VERSION(old_cluster.major_version) >= 804)
    239-
    pg_log(PG_REPORT,
    240-
    "Optimizer statistics are not transferred by pg_upgrade so,\n"
    241-
    "once you start the new server, consider running:\n"
    242-
    " %s\n\n", analyze_script_file_name);
    243-
    else
    244-
    pg_log(PG_REPORT,
    245-
    "Optimizer statistics and free space information are not transferred\n"
    246-
    "by pg_upgrade so, once you start the new server, consider running:\n"
    247-
    " %s\n\n", analyze_script_file_name);
    248-
    237+
    pg_log(PG_REPORT,
    238+
    "Optimizer statistics are not transferred by pg_upgrade so,\n"
    239+
    "once you start the new server, consider running:\n"
    240+
    " %s\n\n", analyze_script_file_name);
    249241

    250242
    if (deletion_script_file_name)
    251243
    pg_log(PG_REPORT,
    @@ -275,7 +267,7 @@ check_cluster_versions(void)
    275267
    * upgrades
    276268
    */
    277269

    278-
    if (GET_MAJOR_VERSION(old_cluster.major_version) <= 803)
    270+
    if (GET_MAJOR_VERSION(old_cluster.major_version) < 804)
    279271
    pg_fatal("This utility can only upgrade from PostgreSQL version 8.4 and later.\n");
    280272

    281273
    /* Only current PG version is supported as a target */
    @@ -510,19 +502,12 @@ create_script_for_cluster_analyze(char **analyze_script_file_name)
    510502
    ECHO_QUOTE, ECHO_QUOTE);
    511503
    fprintf(script, "echo %sthis script and run:%s\n",
    512504
    ECHO_QUOTE, ECHO_QUOTE);
    513-
    fprintf(script, "echo %s \"%s/vacuumdb\" %s--all %s%s\n", ECHO_QUOTE,
    514-
    new_cluster.bindir, user_specification.data,
    515-
    /* Did we copy the free space files? */
    516-
    (GET_MAJOR_VERSION(old_cluster.major_version) >= 804) ?
    517-
    "--analyze-only" : "--analyze", ECHO_QUOTE);
    505+
    fprintf(script, "echo %s \"%s/vacuumdb\" %s--all --analyze-only%s\n", ECHO_QUOTE,
    506+
    new_cluster.bindir, user_specification.data, ECHO_QUOTE);
    518507
    fprintf(script, "echo%s\n\n", ECHO_BLANK);
    519508

    520509
    fprintf(script, "\"%s/vacuumdb\" %s--all --analyze-in-stages\n",
    521510
    new_cluster.bindir, user_specification.data);
    522-
    /* Did we copy the free space files? */
    523-
    if (GET_MAJOR_VERSION(old_cluster.major_version) <= 803)
    524-
    fprintf(script, "\"%s/vacuumdb\" %s--all\n", new_cluster.bindir,
    525-
    user_specification.data);
    526511

    527512
    fprintf(script, "echo%s\n\n", ECHO_BLANK);
    528513
    fprintf(script, "echo %sDone%s\n",

    src/bin/pg_upgrade/relfilenode.c

    Lines changed: 6 additions & 10 deletions
    Original file line numberDiff line numberDiff line change
    @@ -163,16 +163,12 @@ transfer_single_new_db(FileNameMap *maps, int size, char *old_tablespace)
    163163
    /* transfer primary file */
    164164
    transfer_relfile(&maps[mapnum], "", vm_must_add_frozenbit);
    165165

    166-
    /* fsm/vm files added in PG 8.4 */
    167-
    if (GET_MAJOR_VERSION(old_cluster.major_version) >= 804)
    168-
    {
    169-
    /*
    170-
    * Copy/link any fsm and vm files, if they exist
    171-
    */
    172-
    transfer_relfile(&maps[mapnum], "_fsm", vm_must_add_frozenbit);
    173-
    if (vm_crashsafe_match)
    174-
    transfer_relfile(&maps[mapnum], "_vm", vm_must_add_frozenbit);
    175-
    }
    166+
    /*
    167+
    * Copy/link any fsm and vm files, if they exist
    168+
    */
    169+
    transfer_relfile(&maps[mapnum], "_fsm", vm_must_add_frozenbit);
    170+
    if (vm_crashsafe_match)
    171+
    transfer_relfile(&maps[mapnum], "_vm", vm_must_add_frozenbit);
    176172
    }
    177173
    }
    178174
    }

    0 commit comments

    Comments
     (0)
    0