Re: pg_stat_activity.client_addr sometimes null for host connections

From: Rui DeSousa <rui(at)crazybean(dot)net>
To: Erik Wienhold <ewie(at)ewie(dot)name>
Cc: "pgsql-admin(at)lists(dot)postgresql(dot)org" <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_stat_activity.client_addr sometimes null for host connections
Date: 2023-05-04 16:31:29
Message-ID: 10E1C934-CAAF-4863-A774-714B92DFC251@crazybean.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

> On May 4, 2023, at 6:19 AM, Erik Wienhold <ewie(at)ewie(dot)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?

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Rui DeSousa 2023-05-04 16:40:07 Re: unknown postgres ssl error "could not accept SSL connection: Success" and timeout
Previous Message Ameya Bidwalkar 2023-05-04 13:54:02 Partman maintenance function issue