Skip to content

Commit c09164a

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 89406a9 commit c09164a

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
@@ -181,18 +181,10 @@ void
181181
output_completion_banner(char *analyze_script_file_name,
182182
char *deletion_script_file_name)
183183
{
184-
/* Did we copy the free space files? */
185-
if (GET_MAJOR_VERSION(old_cluster.major_version) >= 804)
186-
pg_log(PG_REPORT,
187-
"Optimizer statistics are not transferred by pg_upgrade so,\n"
188-
"once you start the new server, consider running:\n"
189-
" %s\n\n", analyze_script_file_name);
190-
else
191-
pg_log(PG_REPORT,
192-
"Optimizer statistics and free space information are not transferred\n"
193-
"by pg_upgrade so, once you start the new server, consider running:\n"
194-
" %s\n\n", analyze_script_file_name);
195-
184+
pg_log(PG_REPORT,
185+
"Optimizer statistics are not transferred by pg_upgrade so,\n"
186+
"once you start the new server, consider running:\n"
187+
" %s\n\n", analyze_script_file_name);
196188

197189
if (deletion_script_file_name)
198190
pg_log(PG_REPORT,
@@ -222,7 +214,7 @@ check_cluster_versions(void)
222214
* upgrades
223215
*/
224216

225-
if (GET_MAJOR_VERSION(old_cluster.major_version) <= 803)
217+
if (GET_MAJOR_VERSION(old_cluster.major_version) < 804)
226218
pg_fatal("This utility can only upgrade from PostgreSQL version 8.4 and later.\n");
227219

228220
/* Only current PG version is supported as a target */
@@ -459,19 +451,12 @@ create_script_for_cluster_analyze(char **analyze_script_file_name)
459451
ECHO_QUOTE, ECHO_QUOTE);
460452
fprintf(script, "echo %sthis script and run:%s\n",
461453
ECHO_QUOTE, ECHO_QUOTE);
462-
fprintf(script, "echo %s \"%s/vacuumdb\" %s--all %s%s\n", ECHO_QUOTE,
463-
new_cluster.bindir, user_specification.data,
464-
/* Did we copy the free space files? */
465-
(GET_MAJOR_VERSION(old_cluster.major_version) >= 804) ?
466-
"--analyze-only" : "--analyze", ECHO_QUOTE);
454+
fprintf(script, "echo %s \"%s/vacuumdb\" %s--all --analyze-only%s\n", ECHO_QUOTE,
455+
new_cluster.bindir, user_specification.data, ECHO_QUOTE);
467456
fprintf(script, "echo%s\n\n", ECHO_BLANK);
468457

469458
fprintf(script, "\"%s/vacuumdb\" %s--all --analyze-in-stages\n",
470459
new_cluster.bindir, user_specification.data);
471-
/* Did we copy the free space files? */
472-
if (GET_MAJOR_VERSION(old_cluster.major_version) <= 803)
473-
fprintf(script, "\"%s/vacuumdb\" %s--all\n", new_cluster.bindir,
474-
user_specification.data);
475460

476461
fprintf(script, "echo%s\n\n", ECHO_BLANK);
477462
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
@@ -188,16 +188,12 @@ transfer_single_new_db(pageCnvCtx *pageConverter,
188188
/* transfer primary file */
189189
transfer_relfile(pageConverter, &maps[mapnum], "");
190190

191-
/* fsm/vm files added in PG 8.4 */
192-
if (GET_MAJOR_VERSION(old_cluster.major_version) >= 804)
193-
{
194-
/*
195-
* Copy/link any fsm and vm files, if they exist
196-
*/
197-
transfer_relfile(pageConverter, &maps[mapnum], "_fsm");
198-
if (vm_crashsafe_match)
199-
transfer_relfile(pageConverter, &maps[mapnum], "_vm");
200-
}
191+
/*
192+
* Copy/link any fsm and vm files, if they exist
193+
*/
194+
transfer_relfile(pageConverter, &maps[mapnum], "_fsm");
195+
if (vm_crashsafe_match)
196+
transfer_relfile(pageConverter, &maps[mapnum], "_vm");
201197
}
202198
}
203199
}

0 commit comments

Comments
 (0)