Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1puW3Q-00055q-2v for pgsql-admin@arkaria.postgresql.org; Thu, 04 May 2023 10:19:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1puW3P-0004X6-2j for pgsql-admin@arkaria.postgresql.org; Thu, 04 May 2023 10:19:15 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1puW3O-0004Wx-OT for pgsql-admin@lists.postgresql.org; Thu, 04 May 2023 10:19:14 +0000 Received: from mout-u-107.mailbox.org ([2001:67c:2050:101:465::107]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1puW3K-000T0b-Su for pgsql-admin@lists.postgresql.org; Thu, 04 May 2023 10:19:13 +0000 Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-107.mailbox.org (Postfix) with ESMTPS id 4QBqY35FGfz9sbh for ; Thu, 4 May 2023 12:19:03 +0200 (CEST) Date: Thu, 4 May 2023 12:19:03 +0200 (CEST) From: Erik Wienhold To: "pgsql-admin@lists.postgresql.org" Message-ID: <1123557200.1646445.1683195543242@office.mailbox.org> Subject: pg_stat_activity.client_addr sometimes null for host connections MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Normal List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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