aboutsummaryrefslogtreecommitdiff
path: root/src/backend/replication/walsender.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/replication/walsender.c')
-rw-r--r--src/backend/replication/walsender.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c
index 1c1e9f17d2d..6c41844b5f8 100644
--- a/src/backend/replication/walsender.c
+++ b/src/backend/replication/walsender.c
@@ -30,7 +30,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/replication/walsender.c,v 1.17 2010/04/21 00:51:56 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/replication/walsender.c,v 1.18 2010/04/28 16:10:42 heikki Exp $
*
*-------------------------------------------------------------------------
*/
@@ -253,6 +253,24 @@ WalSndHandshake(void)
{
StringInfoData buf;
+ /*
+ * Check that we're logging enough information in the
+ * WAL for log-shipping.
+ *
+ * NOTE: This only checks the current value of
+ * wal_level. Even if the current setting is not
+ * 'minimal', there can be old WAL in the pg_xlog
+ * directory that was created with 'minimal'.
+ * So this is not bulletproof, the purpose is
+ * just to give a user-friendly error message that
+ * hints how to configure the system correctly.
+ */
+ if (wal_level == WAL_LEVEL_MINIMAL)
+ ereport(FATAL,
+ (errcode(ERRCODE_CANNOT_CONNECT_NOW),
+ errmsg("standby connections not allowed because wal_level='minimal'")));
+
+
/* Send a CopyOutResponse message, and start streaming */
pq_beginmessage(&buf, 'H');
pq_sendbyte(&buf, 0);