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 1pubrs-0005hL-Hz for pgsql-admin@arkaria.postgresql.org; Thu, 04 May 2023 16:31:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pubrr-00039j-Hj for pgsql-admin@arkaria.postgresql.org; Thu, 04 May 2023 16:31:43 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pubrr-000363-77 for pgsql-admin@lists.postgresql.org; Thu, 04 May 2023 16:31:43 +0000 Received: from impout009aa.msg.chrl.nc.charter.net ([47.43.20.33] helo=impout009.msg.chrl.nc.charter.net) by magus.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1pubrj-000ZBf-Lq for pgsql-admin@lists.postgresql.org; Thu, 04 May 2023 16:31:42 +0000 Received: from cerberus.crazybean.net ([71.11.29.254]) by cmsmtp with ESMTP id ubrgphnL9HhknubrhpdNqS; Thu, 04 May 2023 16:31:33 +0000 Authentication-Results: crazybean.net; none X-Authority-Analysis: v=2.4 cv=VJjOIvDX c=1 sm=1 tr=0 ts=6453dde5 a=GkUsAQdcAzAk0MT19QAIRQ==:117 a=GkUsAQdcAzAk0MT19QAIRQ==:17 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=P0xRbXHiH_UA:10 a=epTmVMiNAAAA:8 a=BGQCrHBoRqDdLHGTjJUA:9 a=QEXdDO2ut3YA:10 a=bjMILZsnEBEA:10 a=ML2rLzdRF7MA:10 a=ZXulRonScM0A:10 a=ndEWmUVY6Yapc0oHF_P4:22 Received: from smtpclient.apple ( [2001:470:e117:4:5037:c13:78e0:4b10]) by cerberus.crazybean.net (OpenSMTPD) with ESMTPSA id bc381e53 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Thu, 4 May 2023 12:31:32 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.3\)) Subject: Re: pg_stat_activity.client_addr sometimes null for host connections From: Rui DeSousa X-Priority: 3 In-Reply-To: <1123557200.1646445.1683195543242@office.mailbox.org> Date: Thu, 4 May 2023 12:31:29 -0400 Cc: "pgsql-admin@lists.postgresql.org" Content-Transfer-Encoding: quoted-printable Message-Id: <10E1C934-CAAF-4863-A774-714B92DFC251@crazybean.net> References: <1123557200.1646445.1683195543242@office.mailbox.org> To: Erik Wienhold X-Mailer: Apple Mail (2.3696.120.41.1.3) X-CMAE-Envelope: MS4xfKjbboRgRnks+RRt08fx0PqcELM9a/BMr3h9jEK4uyrlCRsT2IdPtMHQNk/+jXZ99vDMYjVV/DJHC7VbYuuuHT2F7p+RgjUnJ/LQyaQegTerJAXjLSUX r5adZdRpaJ3U1X49k/i8QHSpf5DIx+FwpCGqKz91uyu3NnBNjWWUZt7Y0rNaIFsuvdDzZTudPjeMq0PohiZtKqbvIamw+In0cceNaMtuCvwxpTLjOR0ZgpDg List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On May 4, 2023, at 6:19 AM, Erik Wienhold wrote: >=20 > 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. >=20 > This is on v12.14 on Windows Server (regular EnterpriseDB install). = Is this a > known issue or just an undocumented corner case? >=20 > [0] = https://www.postgresql.org/docs/12/monitoring-stats.html#PG-STAT-ACTIVITY-= VIEW >=20 > =E2=80=94 > Erik >=20 >=20 Are those local connections, as those will not have a client_addr? What = does your pg_hba look like?=