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

Commit8d65ea2

Browse files
committed
Don't attempt to limit target database for pg_restore.
There was an apparent attempt to limit the target database forpg_restore to version 7.1.0 or later. Due to a leading zero thiswas interpreted as an octal number, which allowed targets withversion numbers down to 2.87.36. The lowest actual release abovethat was 6.0.0, so that was effectively the limit.Since the success of the restore attempt will depend primarily onon what statements were generated by the dump run, we don't wantpg_restore trying to guess whether a given target should be allowedbased on version number. Allow a connection to any version. Sinceit is very unlikely that anyone would be using a recent version ofpg_restore to restore to a pre-6.0 database, this has little to nopractical impact, but it makes the code less confusing to read.Issue reported and initial patch suggestion from Joel Jacobsonbased on an article by Andrey Karpov reporting on issues found byPVS-Studio static code analyzer. Final patch based on analysis byTom Lane. Back-patch to all supported branches.
1 parent918d74a commit8d65ea2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

‎src/bin/pg_dump/pg_backup_archiver.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,12 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt)
276276
if (AH->version<K_VERS_1_3)
277277
die_horribly(AH,modulename,"direct database connections are not supported in pre-1.3 archives\n");
278278

279-
/* XXX Should get this from the archive */
280-
AHX->minRemoteVersion=070100;
279+
/*
280+
* We don't want to guess at whether the dump will successfully
281+
* restore; allow the attempt regardless of the version of the restore
282+
* target.
283+
*/
284+
AHX->minRemoteVersion=0;
281285
AHX->maxRemoteVersion=999999;
282286

283287
ConnectDatabase(AHX,ropt->dbname,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp