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

Commitd41c11d

Browse files
author
Artur Zakirov
committed
pg_ptrack_enable() should be executed only pg_ptrack_support() returns true
1 parente6a478a commitd41c11d

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

‎backup.c‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,7 @@ do_backup(bool smooth_checkpoint)
400400
{
401401
parray*backup_list;
402402
parray*files_database;
403+
boolis_ptrack_support;
403404

404405
/* PGDATA and BACKUP_MODE are always required */
405406
if (pgdata==NULL)
@@ -427,12 +428,16 @@ do_backup(bool smooth_checkpoint)
427428
elog(ERROR,"backup is not allowed for standby");
428429

429430
/* ptrack backup checks */
430-
if (current.backup_mode==BACKUP_MODE_DIFF_PTRACK&& !pg_ptrack_support())
431+
is_ptrack_support=pg_ptrack_support();
432+
if (current.backup_mode==BACKUP_MODE_DIFF_PTRACK&& !is_ptrack_support)
431433
elog(ERROR,"current Postgres instance does not support ptrack");
432434

433-
is_ptrack_enable=pg_ptrack_enable();
434-
if(current.backup_mode==BACKUP_MODE_DIFF_PTRACK&& !is_ptrack_enable)
435-
elog(ERROR,"ptrack is disabled");
435+
if (is_ptrack_support)
436+
{
437+
is_ptrack_enable=pg_ptrack_enable();
438+
if(current.backup_mode==BACKUP_MODE_DIFF_PTRACK&& !is_ptrack_enable)
439+
elog(ERROR,"ptrack is disabled");
440+
}
436441

437442
/* Get exclusive lock of backup catalog */
438443
catalog_lock(true);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp