Skip to content

Commit 957a782

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 f09e2a8 commit 957a782

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
@@ -202,18 +202,10 @@ void
202202
output_completion_banner(char *analyze_script_file_name,
203203
char *deletion_script_file_name)
204204
{
205-
/* Did we copy the free space files? */
206-
if (GET_MAJOR_VERSION(old_cluster.major_version) >= 804)
207-
pg_log(PG_REPORT,
208-
"Optimizer statistics are not transferred by pg_upgrade so,\n"
209-
"once you start the new server, consider running:\n"
210-
" %s\n\n", analyze_script_file_name);
211-
else
212-
pg_log(PG_REPORT,
213-
"Optimizer statistics and free space information are not transferred\n"
214-
"by pg_upgrade so, once you start the new server, consider running:\n"
215-
" %s\n\n", analyze_script_file_name);
216-
205+
pg_log(PG_REPORT,
206+
"Optimizer statistics are not transferred by pg_upgrade so,\n"
207+
"once you start the new server, consider running:\n"
208+
" %s\n\n", analyze_script_file_name);
217209

218210
if (deletion_script_file_name)
219211
pg_log(PG_REPORT,
@@ -243,7 +235,7 @@ check_cluster_versions(void)
243235
* upgrades
244236
*/
245237

246-
if (GET_MAJOR_VERSION(old_cluster.major_version) <= 803)
238+
if (GET_MAJOR_VERSION(old_cluster.major_version) < 804)
247239
pg_fatal("This utility can only upgrade from PostgreSQL version 8.4 and later.\n");
248240

249241
/* Only current PG version is supported as a target */
@@ -476,19 +468,12 @@ create_script_for_cluster_analyze(char **analyze_script_file_name)
476468
ECHO_QUOTE, ECHO_QUOTE);
477469
fprintf(script, "echo %sthis script and run:%s\n",
478470
ECHO_QUOTE, ECHO_QUOTE);
479-
fprintf(script, "echo %s \"%s/vacuumdb\" %s--all %s%s\n", ECHO_QUOTE,
480-
new_cluster.bindir, user_specification.data,
481-
/* Did we copy the free space files? */
482-
(GET_MAJOR_VERSION(old_cluster.major_version) >= 804) ?
483-
"--analyze-only" : "--analyze", ECHO_QUOTE);
471+
fprintf(script, "echo %s \"%s/vacuumdb\" %s--all --analyze-only%s\n", ECHO_QUOTE,
472+
new_cluster.bindir, user_specification.data, ECHO_QUOTE);
484473
fprintf(script, "echo%s\n\n", ECHO_BLANK);
485474

486475
fprintf(script, "\"%s/vacuumdb\" %s--all --analyze-in-stages\n",
487476
new_cluster.bindir, user_specification.data);
488-
/* Did we copy the free space files? */
489-
if (GET_MAJOR_VERSION(old_cluster.major_version) <= 803)
490-
fprintf(script, "\"%s/vacuumdb\" %s--all\n", new_cluster.bindir,
491-
user_specification.data);
492477

493478
fprintf(script, "echo%s\n\n", ECHO_BLANK);
494479
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
@@ -160,16 +160,12 @@ transfer_single_new_db(FileNameMap *maps, int size, char *old_tablespace)
160160
/* transfer primary file */
161161
transfer_relfile(&maps[mapnum], "", vm_must_add_frozenbit);
162162

163-
/* fsm/vm files added in PG 8.4 */
164-
if (GET_MAJOR_VERSION(old_cluster.major_version) >= 804)
165-
{
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);
172-
}
163+
/*
164+
* Copy/link any fsm and vm files, if they exist
165+
*/
166+
transfer_relfile(&maps[mapnum], "_fsm", vm_must_add_frozenbit);
167+
if (vm_crashsafe_match)
168+
transfer_relfile(&maps[mapnum], "_vm", vm_must_add_frozenbit);
173169
}
174170
}
175171
}

0 commit comments

Comments
 (0)