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

Commit6037abc

Browse files
committed
Check archive_command with archive_mode. Do not set dbname for stream connection.
1 parent9b78401 commit6037abc

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

‎src/backup.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -631,8 +631,6 @@ pg_start_backup(const char *label, bool smooth, pgBackup *backup)
631631
2,
632632
params);
633633

634-
backup_in_progress= true;
635-
636634
/* Extract timeline and LSN from results of pg_start_backup() */
637635
XLogDataFromLSN(PQgetvalue(res,0,0),&xlogid,&xrecoff);
638636
/* Calculate LSN */
@@ -665,6 +663,12 @@ pg_start_backup(const char *label, bool smooth, pgBackup *backup)
665663
/* Wait for start_lsn to be replayed by replica */
666664
if (from_replica)
667665
wait_replica_wal_lsn(backup->start_lsn, true);
666+
667+
/*
668+
* Set flag that pg_start_backup() was called. If an error will happen it
669+
* is necessary to call pg_stop_backup() in backup_cleanup().
670+
*/
671+
backup_in_progress= true;
668672
}
669673

670674
/*
@@ -760,6 +764,15 @@ pg_archive_enabled(void)
760764
return false;
761765
}
762766
PQclear(res_db);
767+
768+
res_db=pgut_execute(backup_conn,"show archive_command",0,NULL);
769+
if (strlen(PQgetvalue(res_db,0,0))==0)
770+
{
771+
PQclear(res_db);
772+
return false;
773+
}
774+
PQclear(res_db);
775+
763776
return true;
764777
}
765778

‎src/pg_probackup.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,6 @@ main(int argc, char *argv[])
327327
}
328328

329329
/* Setup stream options. They are used in streamutil.c. */
330-
if (pgut_dbname!=NULL)
331-
dbname=pstrdup(pgut_dbname);
332330
if (host!=NULL)
333331
dbhost=pstrdup(host);
334332
if (port!=NULL)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp