diff options
author | Simon Riggs <simon@2ndQuadrant.com> | 2010-04-02 21:50:40 +0000 |
---|---|---|
committer | Simon Riggs <simon@2ndQuadrant.com> | 2010-04-02 21:50:40 +0000 |
commit | cf2575b8c42605834f2deddca4a07756345194ec (patch) | |
tree | 675172c299848cea1aaece6f75ccdb8bc214283e /src/backend/access/transam/xlog.c | |
parent | 3e754a89ea328f766cff5c19d3880d63cc3330f8 (diff) | |
download | postgresql-cf2575b8c42605834f2deddca4a07756345194ec.tar.gz postgresql-cf2575b8c42605834f2deddca4a07756345194ec.zip |
Check compulsory parameters in recovery.conf in standby_mode, per docs.
Diffstat (limited to 'src/backend/access/transam/xlog.c')
-rw-r--r-- | src/backend/access/transam/xlog.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 247ba3d8e78..d3c37102519 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.387 2010/04/02 13:10:56 sriggs Exp $ + * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.388 2010/04/02 21:50:40 sriggs Exp $ * *------------------------------------------------------------------------- */ @@ -5086,11 +5086,23 @@ readRecoveryCommandFile(void) cmdline), errhint("Lines should have the format parameter = 'value'."))); - /* If not in standby mode, restore_command must be supplied */ - if (!StandbyMode && recoveryRestoreCommand == NULL) - ereport(FATAL, - (errmsg("recovery command file \"%s\" did not specify restore_command nor standby_mode", - RECOVERY_COMMAND_FILE))); + /* + * Check for compulsory parameters + */ + if (StandbyMode) + { + if (PrimaryConnInfo == NULL && recoveryRestoreCommand == NULL) + ereport(FATAL, + (errmsg("recovery command file \"%s\" specified neither primary_conninfo nor restore_command", + RECOVERY_COMMAND_FILE))); + } + else + { + if (recoveryRestoreCommand == NULL) + ereport(FATAL, + (errmsg("recovery command file \"%s\" did not specify restore_command nor standby_mode", + RECOVERY_COMMAND_FILE))); + } /* Enable fetching from archive recovery area */ InArchiveRecovery = true; |