1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-09 06:21:09 +03:00

Make pg_recievexlog by default loop on connection failures

Avoids the need for an external script in the most common
scenario. Behavior can be overridden using the -n/--noloop
commandline parameter.
This commit is contained in:
Magnus Hagander
2012-05-27 11:05:24 +02:00
parent 2b97db61dd
commit 16282ae688
4 changed files with 67 additions and 4 deletions

View File

@@ -279,6 +279,9 @@ StartLogStreamer(char *startpos, uint32 timeline, char *sysidentifier)
/* Get a second connection */
param->bgconn = GetConnection();
if (!param->bgconn)
/* Error message already written in GetConnection() */
exit(1);
/*
* Always in plain format, so we can write to basedir/pg_xlog. But the
@@ -915,6 +918,9 @@ BaseBackup(void)
* Connect in replication mode to the server
*/
conn = GetConnection();
if (!conn)
/* Error message already written in GetConnection() */
exit(1);
/*
* Run IDENTIFY_SYSTEM so we can get the timeline