Commit a383c55a authored by Heikki Linnakangas's avatar Heikki Linnakangas

Throw a nicer error message if a standby server attempts to connect while

the master is still in recovery. We don't support cascading slaves yet.

Patch by Fujii Masao, with slightly changed wording.
parent bd11a0f6
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/replication/walsender.c,v 1.9 2010/02/26 02:00:58 momjian Exp $ * $PostgreSQL: pgsql/src/backend/replication/walsender.c,v 1.10 2010/03/16 09:09:55 heikki Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -119,6 +119,11 @@ WalSenderMain(void) ...@@ -119,6 +119,11 @@ WalSenderMain(void)
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
errmsg("must be superuser to start walsender"))); errmsg("must be superuser to start walsender")));
if (RecoveryInProgress())
ereport(FATAL,
(errcode(ERRCODE_CANNOT_CONNECT_NOW),
errmsg("recovery is still in progress, can't accept WAL streaming connections")));
/* Create a per-walsender data structure in shared memory */ /* Create a per-walsender data structure in shared memory */
InitWalSnd(); InitWalSnd();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment