Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 700b700

Browse filesBrowse 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 0e78dca commit 700b700
Copy full SHA for 700b700

File tree

Expand file treeCollapse file tree

2 files changed

+13
-32
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+13
-32
lines changed

‎src/bin/pg_upgrade/check.c

Copy file name to clipboardExpand all lines: src/bin/pg_upgrade/check.c
+7-22Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -186,18 +186,10 @@ void
186186
output_completion_banner(char *analyze_script_file_name,
187187
char *deletion_script_file_name)
188188
{
189-
/* Did we copy the free space files? */
190-
if (GET_MAJOR_VERSION(old_cluster.major_version) >= 804)
191-
pg_log(PG_REPORT,
192-
"Optimizer statistics are not transferred by pg_upgrade so,\n"
193-
"once you start the new server, consider running:\n"
194-
" %s\n\n", analyze_script_file_name);
195-
else
196-
pg_log(PG_REPORT,
197-
"Optimizer statistics and free space information are not transferred\n"
198-
"by pg_upgrade so, once you start the new server, consider running:\n"
199-
" %s\n\n", analyze_script_file_name);
200-
189+
pg_log(PG_REPORT,
190+
"Optimizer statistics are not transferred by pg_upgrade so,\n"
191+
"once you start the new server, consider running:\n"
192+
" %s\n\n", analyze_script_file_name);
201193

202194
if (deletion_script_file_name)
203195
pg_log(PG_REPORT,
@@ -227,7 +219,7 @@ check_cluster_versions(void)
227219
* upgrades
228220
*/
229221

230-
if (GET_MAJOR_VERSION(old_cluster.major_version) <= 803)
222+
if (GET_MAJOR_VERSION(old_cluster.major_version) < 804)
231223
pg_fatal("This utility can only upgrade from PostgreSQL version 8.4 and later.\n");
232224

233225
/* Only current PG version is supported as a target */
@@ -470,19 +462,12 @@ create_script_for_cluster_analyze(char **analyze_script_file_name)
470462
ECHO_QUOTE, ECHO_QUOTE);
471463
fprintf(script, "echo %sthis script and run:%s\n",
472464
ECHO_QUOTE, ECHO_QUOTE);
473-
fprintf(script, "echo %s \"%s/vacuumdb\" %s--all %s%s\n", ECHO_QUOTE,
474-
new_cluster.bindir, user_specification.data,
475-
/* Did we copy the free space files? */
476-
(GET_MAJOR_VERSION(old_cluster.major_version) >= 804) ?
477-
"--analyze-only" : "--analyze", ECHO_QUOTE);
465+
fprintf(script, "echo %s \"%s/vacuumdb\" %s--all --analyze-only%s\n", ECHO_QUOTE,
466+
new_cluster.bindir, user_specification.data, ECHO_QUOTE);
478467
fprintf(script, "echo%s\n\n", ECHO_BLANK);
479468

480469
fprintf(script, "\"%s/vacuumdb\" %s--all --analyze-in-stages\n",
481470
new_cluster.bindir, user_specification.data);
482-
/* Did we copy the free space files? */
483-
if (GET_MAJOR_VERSION(old_cluster.major_version) <= 803)
484-
fprintf(script, "\"%s/vacuumdb\" %s--all\n", new_cluster.bindir,
485-
user_specification.data);
486471

487472
fprintf(script, "echo%s\n\n", ECHO_BLANK);
488473
fprintf(script, "echo %sDone%s\n",

‎src/bin/pg_upgrade/relfilenode.c

Copy file name to clipboardExpand all lines: src/bin/pg_upgrade/relfilenode.c
+6-10Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -158,16 +158,12 @@ transfer_single_new_db(FileNameMap *maps, int size, char *old_tablespace)
158158
/* transfer primary file */
159159
transfer_relfile(&maps[mapnum], "", vm_must_add_frozenbit);
160160

161-
/* fsm/vm files added in PG 8.4 */
162-
if (GET_MAJOR_VERSION(old_cluster.major_version) >= 804)
163-
{
164-
/*
165-
* Copy/link any fsm and vm files, if they exist
166-
*/
167-
transfer_relfile(&maps[mapnum], "_fsm", vm_must_add_frozenbit);
168-
if (vm_crashsafe_match)
169-
transfer_relfile(&maps[mapnum], "_vm", vm_must_add_frozenbit);
170-
}
161+
/*
162+
* Copy/link any fsm and vm files, if they exist
163+
*/
164+
transfer_relfile(&maps[mapnum], "_fsm", vm_must_add_frozenbit);
165+
if (vm_crashsafe_match)
166+
transfer_relfile(&maps[mapnum], "_vm", vm_must_add_frozenbit);
171167
}
172168
}
173169
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.