aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/init/postinit.c
diff options
context:
space:
mode:
authorSimon Riggs <simon@2ndQuadrant.com>2010-03-19 19:19:38 +0000
committerSimon Riggs <simon@2ndQuadrant.com>2010-03-19 19:19:38 +0000
commit6a771d1d367d7e204edf78aee3f069f1b5ba36db (patch)
tree442f83f1544ea0ca7fd811d9472bcc81649801db /src/backend/utils/init/postinit.c
parent75867c528d45829c39b2aba29e0617e3c381ce52 (diff)
downloadpostgresql-6a771d1d367d7e204edf78aee3f069f1b5ba36db.tar.gz
postgresql-6a771d1d367d7e204edf78aee3f069f1b5ba36db.zip
Add connection messages for streaming replication. log_connections
was broken for a replication connection and no messages were displayed on either standby or primary, at any debug level. Connection messages needed to diagnose session drop/reconnect events. Use LOG mode for now, discuss lowering in later releases.
Diffstat (limited to 'src/backend/utils/init/postinit.c')
-rw-r--r--src/backend/utils/init/postinit.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/backend/utils/init/postinit.c b/src/backend/utils/init/postinit.c
index 01cb07da2d3..026ee474844 100644
--- a/src/backend/utils/init/postinit.c
+++ b/src/backend/utils/init/postinit.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/init/postinit.c,v 1.204 2010/02/26 02:01:13 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/init/postinit.c,v 1.205 2010/03/19 19:19:38 sriggs Exp $
*
*
*-------------------------------------------------------------------------
@@ -217,7 +217,14 @@ PerformAuthentication(Port *port)
if (!disable_sig_alarm(true))
elog(FATAL, "could not disable timer for authorization timeout");
- if (Log_connections)
+ /*
+ * Log connection for streaming replication even if Log_connections disabled.
+ */
+ if (am_walsender)
+ ereport(LOG,
+ (errmsg("connection authorized: user=%s database=replication",
+ port->user_name)));
+ else if (Log_connections)
ereport(LOG,
(errmsg("connection authorized: user=%s database=%s",
port->user_name, port->database_name)));