pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rui DeSousa <rui@crazybean.net>
To: Erik Wienhold <ewie@ewie.name>
Cc: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Subject: Re: pg_stat_activity.client_addr sometimes null for host connections
Date: Thu, 4 May 2023 12:31:29 -0400
Message-ID: <10E1C934-CAAF-4863-A774-714B92DFC251@crazybean.net> (raw)
In-Reply-To: <1123557200.1646445.1683195543242@office.mailbox.org>
References: <1123557200.1646445.1683195543242@office.mailbox.org>



> On May 4, 2023, at 6:19 AM, Erik Wienhold <ewie@ewie.name> wrote:
> 
> I have a process that regularly queries pg_stat_activity for user connections.
> Today I noticed an error because sometimes client_addr is null for some user
> connections.  pg_hba.conf only allows host connections.  So client_addr should
> not be null according to [0].  pg_stat_activity is queried as superuser who
> should see client_addr for all connections, not just his own.
> 
> This is on v12.14 on Windows Server (regular EnterpriseDB install).  Is this a
> known issue or just an undocumented corner case?
> 
> [0] https://www.postgresql.org/docs/12/monitoring-stats.html#PG-STAT-ACTIVITY-VIEW
> 
> —
> Erik
> 
> 

Are those local connections, as those will not have a client_addr?  What does your pg_hba look like?




view thread (5+ messages)  latest in thread

Message-ID: <10E1C934-CAAF-4863-A774-714B92DFC251@crazybean.net>
Permalink:  ../10E1C934-CAAF-4863-A774-714B92DFC251@crazybean.net/
Also on:    postgresql.org/message-id/10E1C934-CAAF-4863-A774-714B92DFC251@crazybean.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: rui@crazybean.net, ewie@ewie.name, pgsql-admin@lists.postgresql.org
  Subject: Re: pg_stat_activity.client_addr sometimes null for host connections
  In-Reply-To: <10E1C934-CAAF-4863-A774-714B92DFC251@crazybean.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox