aboutsummaryrefslogtreecommitdiff
path: root/src/bin/pg_basebackup/pg_basebackup.c
diff options
context:
space:
mode:
authorMagnus Hagander <magnus@hagander.net>2012-05-27 11:05:24 +0200
committerMagnus Hagander <magnus@hagander.net>2012-05-27 11:05:24 +0200
commit16282ae688de2b320cf176e9be8a89e4dfc60698 (patch)
treeafcdccdc812a01494100a14638653d4c023980b6 /src/bin/pg_basebackup/pg_basebackup.c
parent2b97db61dd0bffb0843eb2ea9be054d925e88ef1 (diff)
downloadpostgresql-16282ae688de2b320cf176e9be8a89e4dfc60698.tar.gz
postgresql-16282ae688de2b320cf176e9be8a89e4dfc60698.zip
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.
Diffstat (limited to 'src/bin/pg_basebackup/pg_basebackup.c')
-rw-r--r--src/bin/pg_basebackup/pg_basebackup.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/bin/pg_basebackup/pg_basebackup.c b/src/bin/pg_basebackup/pg_basebackup.c
index 6a2e557809a..d7466168d78 100644
--- a/src/bin/pg_basebackup/pg_basebackup.c
+++ b/src/bin/pg_basebackup/pg_basebackup.c
@@ -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