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

Re: log_hostname and pg_stat_activity

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Steve Singer <ssinger_pg(at)sympatico(dot)ca>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: log_hostname and pg_stat_activity
Date: 2011-02-01 18:09:44
Message-ID: 1296583784.4145.4.camel@vanquo.pezone.net (view raw or flat)
Thread:
Lists: pgsql-hackers
On tis, 2011-01-18 at 19:24 -0500, Steve Singer wrote:
> However if I connect with a line in pg_hba that matches on an IP
> network then my client_hostname is always null unless log_hostname is
> set to true.  This is consistent with the behavior you describe but I
> think the average user will find it a bit confusing.  Having a column
> that is always null unless a GUC is set is less than ideal but I
> understand why log_hostname isn't on by default. 

Well, we have all these track_* variables, which also control what
appears in the statistics views.

After thinking about this some more, I think it might be better to be
less cute and forget about the interaction with the pg_hba.conf hostname
behavior.  That is, the host name is set if and only if log_hostname is
on.  Otherwise you will for example have an inconsistency between the
statistics views and the server log, unless you want to argue that we
can override the log_hostname setting based on what happens in
pg_hba.conf.  That's just getting too weird.



In response to

Responses

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2011-02-01 18:10:35
Subject: Re: pg_upgrade fails for non-postgres user
Previous:From: Kevin GrittnerDate: 2011-02-01 17:58:52
Subject: Re: Spread checkpoint sync

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