Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitbe304cf

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 HaganderDiscussion:https://postgr.es/m/CABUevEx-D0PNVe00tkeQRGennZQwDtBJn=493MJt-x6sppbUxA@mail.gmail.comBackpatch-through: 9.5
1 parent2cb4b8e commitbe304cf

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

242234
if (deletion_script_file_name)
243235
pg_log(PG_REPORT,
@@ -267,7 +259,7 @@ check_cluster_versions(void)
267259
* upgrades
268260
*/
269261

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

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

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

519504
fprintf(script,"echo%s\n\n",ECHO_BLANK);
520505
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)

[8]ページ先頭

©2009-2025 Movatter.jp