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 1ve0Ji-007jJe-18 for pgsql-hackers@arkaria.postgresql.org; Fri, 09 Jan 2026 00:25:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1ve0Jh-0052D1-0P for pgsql-hackers@arkaria.postgresql.org; Fri, 09 Jan 2026 00:25:25 +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 1ve0Jg-0052Ct-2e for pgsql-hackers@lists.postgresql.org; Fri, 09 Jan 2026 00:25:25 +0000 Received: from fhigh-b7-smtp.messagingengine.com ([202.12.124.158]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1ve0Je-005NKB-2a for pgsql-hackers@lists.postgresql.org; Fri, 09 Jan 2026 00:25:24 +0000 Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfhigh.stl.internal (Postfix) with ESMTP id EC84E7A00BF; Thu, 8 Jan 2026 19:25:19 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Thu, 08 Jan 2026 19:25:20 -0500 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=fm2; t=1767918319; x=1768004719; bh=fkfvckI7jE haa7LVITXCkzPft0snNseqV0auIYlAqUY=; b=bvoCoyEkUBbQdHpCzQXpWi8ikk YX70U614avGtGpfwTzOcXhgCpMvr6Qni8G7OzBEX0bdHLDGb9zi1YRizrqFYohSj bO7M0hqANz0GZU4ismWapSesl4aFyqxKvh2qri5RBh/irtHWJM32UUu9DQ2ZCLS3 FdvYMWR/T01tTiqjlWq+gPdfv9KePaZX/c0QucGKQbvnHA3U6FGv5r7vlkwzXZfu //G+mF2vrUIcs0Y+IfKsKCsFVTVNhZHrEmMkD+erN/e8+eN61NaBoB5S7dyr6hGb MXDTnay+rwKFzKhN8VeHEVGffSWAic0owp0HfjtlvTFow4gMR5ibVKf+DkMA== 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=fm2; t= 1767918319; x=1768004719; bh=fkfvckI7jEhaa7LVITXCkzPft0snNseqV0a uIYlAqUY=; b=vLTlaUGUryK+usYMu878Og2eLcOpqdRPuKPuXbPfI/SQbja8Tmx 8kRm07gpsZGYaJ5DnLqATUP6wo4vCNr4QY1Ea8M52N+fgI39AzFe6eA5M9J4cAHa 9/23s7rdw7GbYo7HVo6Z+AiIbPin73X1yfBh5TGpnnJMrvO1PvxLLvxw0o3tefxf RRQb3vP2kRZrSyiATZRcTus/4cg6SbfRMYU3sp8kqjfu9Nd4k2sq789iauILVEVf 5wm1uDJWqQgjEOUlh22LPyW5bU2fwXicFOdYzmR7pYvWKxRhsu4HTjIp+IKs6bf1 43iYqsPh/pWvZry3unLHrzn+62VZOqHgO1Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddutdejfeekucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrh hlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredttddv necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeggeeg fffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiidp nhgspghrtghpthhtohepvddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepphgrvh hlohdrghholhhusgestgihsggvrhhtvggtrdgrthdprhgtphhtthhopehpghhsqhhlqdhh rggtkhgvrhhssehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 8 Jan 2026 19:25:18 -0500 (EST) Date: Fri, 9 Jan 2026 09:25:01 +0900 From: Michael Paquier To: Pavlo Golub Cc: pgsql-hackers@lists.postgresql.org Subject: Re: [PATCH] Add pg_current_vxact_id() function to expose virtual transaction IDs Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="vVsDsM2h+erj4XLB" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --vVsDsM2h+erj4XLB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Dec 08, 2025 at 12:09:58PM +0000, Pavlo Golub wrote: > Virtual transaction IDs are fundamental to PostgreSQL's transaction > tracking, > appearing in pg_locks.virtualtransaction, log output via %v placeholder, and > internal transaction management. However, there's currently no direct SQL > function to retrieve the current VXID, forcing applications to query > pg_locks > or parse log files to obtain this information. This is replacing one SQL in a given session by another, as a session currently running a transaction can query itself pg_locks and match an entry with its own pg_backend_pid(). Hence I don't see the need for this function, except simplicity in retrieving a session's state with less characters typed at the end? Thoughts and opinions from others are welcome. I'm always OK to be outvoted. -- Michael --vVsDsM2h+erj4XLB Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmlgSt0ACgkQnvQgOdby QH0yiQ/8DOQ5YoPXpLZr+vASRN2jvIx9IbRLYCSwgdwO3bsPXQ4onK+HIpWqOcKc ITN5bao/nitDWQsJjJ/n0K7sxNRvfCb1MruGS+hDpQZJeUmtBIlApeJftGJOLT3l 5mCD1/w5aKhzc9yGGrmQ7NVD3upQFv4XYn0dnHzojgAR00bgacIZLgT7xsahF1SX WbY89QTDwKVscqFa3IPC0jOk5yDKeLV3TNRleNS2DFW6+C7EUf+XwJ0Ch6C7wswY uzLJhBt6VpbIid+zS2IFP9EFMYCQ691peG/ICNK64rQETADS39QhUwEf/ZOSFf2f Zt3aQGT0muICQ/oKjNlR87SDpetyu9BFL33jyXgdAvQb/Z7lAat5QjeF9chmnQb2 MaQkOXkcGPyI3agIR/V1vxVMRVWyPIsmBCh/1obpYsPX6lbdFuwSdrnlpxTemgkI mWO5NcwvcnvMk5w4pvaBc0LGgxYvk/yG/4/JVNjHKvFVTf1uYpKOVqyQ5jdtwl1n mHIhAW9Sr7UWRUfa8KI/z1j0f/zOyYpi1WV5rKQ3iaBv07Q4haq6d07mdOJKqBfn FgfSp3dvh7cJN08hJoaGEBSNc9FwbIN1bZLRl+zL84Ym3Kc7PyWTr8s3asqXqn8o SIvxfMm4Dpp66Z5JoiVTAwMDhO/7vq348A7oFcus541zCsH+s3g= =QEjI -----END PGP SIGNATURE----- --vVsDsM2h+erj4XLB--