Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 77971bc

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 dc39534 commit 77971bc

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
@@ -227,18 +227,10 @@ void
227227
output_completion_banner(char *analyze_script_file_name,
228228
char *deletion_script_file_name)
229229
{
230-
/* Did we copy the free space files? */
231-
if (GET_MAJOR_VERSION(old_cluster.major_version) >= 804)
232-
pg_log(PG_REPORT,
233-
"Optimizer statistics are not transferred by pg_upgrade so,\n"
234-
"once you start the new server, consider running:\n"
235-
" %s\n\n", analyze_script_file_name);
236-
else
237-
pg_log(PG_REPORT,
238-
"Optimizer statistics and free space information are not transferred\n"
239-
"by pg_upgrade so, once you start the new server, consider running:\n"
240-
" %s\n\n", analyze_script_file_name);
241-
230+
pg_log(PG_REPORT,
231+
"Optimizer statistics are not transferred by pg_upgrade so,\n"
232+
"once you start the new server, consider running:\n"
233+
" %s\n\n", analyze_script_file_name);
242234

243235
if (deletion_script_file_name)
244236
pg_log(PG_REPORT,
@@ -268,7 +260,7 @@ check_cluster_versions(void)
268260
* upgrades
269261
*/
270262

271-
if (GET_MAJOR_VERSION(old_cluster.major_version) <= 803)
263+
if (GET_MAJOR_VERSION(old_cluster.major_version) < 804)
272264
pg_fatal("This utility can only upgrade from PostgreSQL version 8.4 and later.\n");
273265

274266
/* Only current PG version is supported as a target */
@@ -503,19 +495,12 @@ create_script_for_cluster_analyze(char **analyze_script_file_name)
503495
ECHO_QUOTE, ECHO_QUOTE);
504496
fprintf(script, "echo %sthis script and run:%s\n",
505497
ECHO_QUOTE, ECHO_QUOTE);
506-
fprintf(script, "echo %s \"%s/vacuumdb\" %s--all %s%s\n", ECHO_QUOTE,
507-
new_cluster.bindir, user_specification.data,
508-
/* Did we copy the free space files? */
509-
(GET_MAJOR_VERSION(old_cluster.major_version) >= 804) ?
510-
"--analyze-only" : "--analyze", ECHO_QUOTE);
498+
fprintf(script, "echo %s \"%s/vacuumdb\" %s--all --analyze-only%s\n", ECHO_QUOTE,
499+
new_cluster.bindir, user_specification.data, ECHO_QUOTE);
511500
fprintf(script, "echo%s\n\n", ECHO_BLANK);
512501

513502
fprintf(script, "\"%s/vacuumdb\" %s--all --analyze-in-stages\n",
514503
new_cluster.bindir, user_specification.data);
515-
/* Did we copy the free space files? */
516-
if (GET_MAJOR_VERSION(old_cluster.major_version) <= 803)
517-
fprintf(script, "\"%s/vacuumdb\" %s--all\n", new_cluster.bindir,
518-
user_specification.data);
519504

520505
fprintf(script, "echo%s\n\n", ECHO_BLANK);
521506
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
@@ -168,16 +168,12 @@ transfer_single_new_db(FileNameMap *maps, int size, char *old_tablespace)
168168
/* transfer primary file */
169169
transfer_relfile(&maps[mapnum], "", vm_must_add_frozenbit);
170170

171-
/* fsm/vm files added in PG 8.4 */
172-
if (GET_MAJOR_VERSION(old_cluster.major_version) >= 804)
173-
{
174-
/*
175-
* Copy/link any fsm and vm files, if they exist
176-
*/
177-
transfer_relfile(&maps[mapnum], "_fsm", vm_must_add_frozenbit);
178-
if (vm_crashsafe_match)
179-
transfer_relfile(&maps[mapnum], "_vm", vm_must_add_frozenbit);
180-
}
171+
/*
172+
* Copy/link any fsm and vm files, if they exist
173+
*/
174+
transfer_relfile(&maps[mapnum], "_fsm", vm_must_add_frozenbit);
175+
if (vm_crashsafe_match)
176+
transfer_relfile(&maps[mapnum], "_vm", vm_must_add_frozenbit);
181177
}
182178
}
183179
}

0 commit comments

Comments
 (0)