Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x60lc-000PyD-26 for pgsql-hackers@arkaria.postgresql.org; Mon, 14 Sep 2026 07:06:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1x60lc-00BjPF-17 for pgsql-hackers@arkaria.postgresql.org; Mon, 14 Sep 2026 07:06:16 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x60lb-00BjP6-2Q for pgsql-hackers@lists.postgresql.org; Mon, 14 Sep 2026 07:06:16 +0000 Received: from fhigh-b5-smtp.messagingengine.com ([202.12.124.156]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1x60lY-00000000K6x-11ou for pgsql-hackers@lists.postgresql.org; Mon, 14 Sep 2026 07:06:15 +0000 Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfhigh.stl.internal (Postfix) with ESMTP id 7EDF07A008A; Mon, 14 Sep 2026 03:06:10 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Mon, 14 Sep 2026 03:06:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1789369570; x=1789455970; bh=VDSpG1QAhL VoMjEirwl5nJ1a/BAfTFMp8Tr4AHUObJM=; b=OwYAs/AZPfJMyBmF7nVvs5Q5V4 6B+Ym1IUthGhfz8BsKdk7WnFpGK/bReL3SUm41plc5zPoqVYi1fTOKn7TS8NWsiI nD5Xkr/f29l0+HxX8aW2aIiYddsTk7klq+QJi8mMbRnfLuEgu5bdBbnR7HEmI0oO kgYrC4MQlk0O/khEK0s3SxKrWM4sMbwy6GcnoqJlMtt51T1MPfG6AsjUKZc13M/2 +23tX1PYPfWKKRMkj25ocH2F15YcT6XxJ9SPsveo6ollGxYjU4vsFeoQgwLlIOcO ApZR2gkFG+EkkWYCWcTVS/OtHshG/ImX1U/MdjReJvgaxPqshg7VDVRwmv/g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1789369570; x=1789455970; bh=VDSpG1QAhLVoMjEirwl5nJ1a/BAfTFMp8Tr 4AHUObJM=; b=wxpQGCQrjCUuHeCO7z/RyAYQuulYQRsp9tg8DXXialHOiyjGTwa ejOKAFX8C0Fht7idRtKJWJJ4d1WKQMEk/hNdf4FCgqbVnTLm7JevVRCX2WnOVx2N UwKT/sTtI/wLD/9aH8SwwcmFk8N0HA3qwoD7RXH00fz8ZKhSg/kROdYeAnomk+n8 3VTodFr/w2ekk/cnHSWhwI99HfLw0CAWkLL95NjHf7gCL7+YJyH6/fIa/g1CNF3H /pzRLaY3SrLGL6wWZ+/MUzG6nz2FmwBEIfzwFHgkQk1llTl8BMWSYLiEl/1EzEeJ B+QeYX3C/1zbnAZdQK6cMyFvxw9jSY300oA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTEcrewbErILjKu1XhddJKytpGRyFyq0suAeo9nInq/urjo8uOgRMZF9SjTNeOFOAG pFflU9S8/slkP3NVlQLn+3ecjoUt4MvBjQ/yoGfJSFNVtYYu440u2BIL+P3+TZaPV8XTTx GGiuj9k7FVzRt7aP8sylregRcat8C57fURTd/T2q1dq7qu87dMxFP+0ybQMqzqpiNx6/pk gFap8tNdvYTEvrRDoroVMUkjgxYDEa4opzxbdaEqjk3+Z/irQLqPa7FVsvQ0KSA6zFIe1s P8XZDZiUNIQhMvNjXsWkgrNqK1gaxaoev9xq+IoYNVCv4nS1aCPH7NZ/rxa2OUry3wKDUo 050y/nCgzjOQ9DmQIPacSjGFGeuzS58EZk8FaLaDc14+D2AUimolKPVJJ/4Wqpk+I5udjT VD1DK629WvvAo3px+4Qj/OT9qXrY77fqf9TNJ4G5gOfHmwVjsDsSDtS9ukl9n+lG0vPNwl 8H5bb5pOWT8bddMbQa/WzBM9f//Af9ijfA9D9i/pKT40qTHVb5HW/G50d3qi7NwstnwgXf H9gxm47NsF6g9e7uTb7dp3+8PBXoUPYCF9br0KzsWh5Fie/qSvyoHgTm3pKE+ZmuXHvhgx n+o3jricgamtVZrND0hMpFvhnyRTsPROkszTAy9SK2weR3DJPWFobcWCqIKw X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 14 Sep 2026 03:06:08 -0400 (EDT) Date: Mon, 14 Sep 2026 16:06:04 +0900 From: Michael Paquier To: shihao zhong Cc: Jim Jones , pgsql-hackers , Bertrand Drouvot Subject: Re: Add a permission check to pg_stat_get_backend_subxact() Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="MwKIlTKFS1AsIyPX" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --MwKIlTKFS1AsIyPX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Sep 12, 2026 at 08:43:28AM -0400, shihao zhong wrote: > Thanks for committing that, I will not include 0001 in the following emai= ls. Fixed the subxact_overflow -> subxact_overflowed, as that's independent. > 1. The first test block ran as superuser, so the owner branch of > HAS_PGSTAT_PERMISSIONS() was never exercised: with "userid" forced to > InvalidOid the test still passed. The block now grants the test role > membership in the session's role instead. With that, forcing userid > to InvalidOid fails the test, and removing the checks fails the > "unrelated role" block. >=20 > 2. The doc paragraph above the per-backend table said the functions > "return NULL", but activity/wait_event return " privilege>" and the SRFs return no rows. Reworded. >=20 > 3. Commit message: noted that processes owned by no role (autovacuum > workers, WAL writer, ...) are now visible only to superusers and > pg_read_all_stats, as in pg_stat_activity, and that no backpatch is > done. That seems globally sensible, at quick glance. I am also adding Bertrand Drouvot in CC to comment about this change, as he has worked on three of these functions. @Bertrand, what do you think? -- Michael --MwKIlTKFS1AsIyPX Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmqnnNwACgkQnvQgOdby QH1DnQ//Zpkfjzic1IpUcTJ6g/VPPWApwlXAY31Fus/jIRqMw4YaYuUlfGFOLHCP Xrh3p9LZNsavc/1hER+hjyv3AngmKWt4PtCv2J2NwU3e/XCwbl66fZUemHRPlUbc PBL7TOJsFi1x0T3h75bRjog6qHbxQAcHBZOZdElCzzv3i+7fVF63c40Uw0HWO5Qv zfv7MyL8axgrb+uKe28LgDfV+y1+2DWyuSpP/3LPiBQX4xERbZO8ocwt2V9mjWOU tN36PGB6akU5L5wT2dZ7CTDmc7othAvKv80ADqm0Ku+css+lxNkedObDqtnjUEfE e/LdkYOo//g0/EtHtiV+ORdZEnoJaRDkqrFzAOVOQZscGHOj2dJxlPlvWtPZ3FVk Wyr345us6Kp9EAuBs1wf90Y1QXukynyfMv6wrfxOeANONwqi+PsEVmeFMgG2+0oG eSEZgAV9pbDZAjvuKCdBtij6Xd/tL9c30OrdzJG4MdbuHfC9bmHxR0K1zg3kfQgf AF4u8UmlvVQMrXSJwDQX+nG8lsm3nhi3R4/P78mHNGBdIulSAb1hM3lkTuhby5xT jUt37Eh1RdZL9/6OZEu+ZH1deIj/5f3Td1YYubUcCc94v+5AwlKS/GxFb6XkSKiy UKfnsULIRWQVnjgdl1HKbiOYCIxzFADf16BgKCDbW5RGN4VrluY= =AmtW -----END PGP SIGNATURE----- --MwKIlTKFS1AsIyPX--