Skip site navigation (1) Skip section navigation (2)

Re: pgsql: Change replication connection log format to allow for a database

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Simon Riggs <sriggs(at)postgresql(dot)org>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Change replication connection log format to allow for a database
Date: 2010-03-25 16:52:46
Message-ID: 4BAB94DE.6080806@enterprisedb.com (view raw or flat)
Thread:
Lists: pgsql-committers
Simon Riggs wrote:
> Log Message:
> -----------
> Change replication connection log format to allow for a database
> called replication. Add host and port details, following format
> of messages in BackendInitialize().

Thanks!

I'm afraid this doesn't translate well:

> --- 222,232 ----
>   	 */
>   	if (am_walsender)
>   		ereport(LOG,
> ! 				(errmsg("replication connection authorized: user=%s host=%s%s%s",
> ! 						port->user_name,
> ! 						port->remote_host, port->remote_port[0] ? " port=" : "",
> ! 						port->remote_port)));
> ! 
>   	else if (Log_connections)
>   		ereport(LOG,
>   				(errmsg("connection authorized: user=%s database=%s",

If you want display the port (I'm not sure if it's of much interest),
I'd suggest something like:

if (port->remote_port[0])
  ereport(LOG,
    (errmsg("replication connection authorized: user=%s host=%s port=%s",
            port->user_name,
            port->remote_host,
            port->remote_port[0])));
else
  ereport(LOG,
    (errmsg("replication connection authorized: user=%s host=%s",
            port->user_name,
            port->remote_host)));


-- 
  Heikki Linnakangas
  EnterpriseDB   http://www.enterprisedb.com

In response to

Responses

pgsql-committers by date

Next:From: Heikki LinnakangasDate: 2010-03-25 16:54:57
Subject: Re: pgsql: Change replication connection log format to allow for a database
Previous:From: Tom LaneDate: 2010-03-25 15:50:22
Subject: pgsql: Fix ginint4_queryextract() to actually do what it was intended to

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group