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.94.2) (envelope-from ) id 1uHXEd-0045Ww-HZ for pgsql-hackers@arkaria.postgresql.org; Wed, 21 May 2025 00:23:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uHXDc-000m2L-Hg for pgsql-hackers@arkaria.postgresql.org; Wed, 21 May 2025 00:22:00 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uHXDc-000lzR-2n for pgsql-hackers@lists.postgresql.org; Wed, 21 May 2025 00:22:00 +0000 Received: from fout-b5-smtp.messagingengine.com ([202.12.124.148]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uHXDW-0002o9-1b for pgsql-hackers@lists.postgresql.org; Wed, 21 May 2025 00:21:58 +0000 Received: from phl-compute-06.internal (phl-compute-06.phl.internal [10.202.2.46]) by mailfout.stl.internal (Postfix) with ESMTP id AEFC711400C7; Tue, 20 May 2025 20:21:53 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Tue, 20 May 2025 20:21:53 -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=fm3; t=1747786913; x=1747873313; bh=bU7Gs9vp4G 9j6qz0PDGWXjm/80iefa+rtyY3v7Bn72w=; b=PdItI9DNoLrykSVoLfuPi9G1TH EAb4CbevGaNZCk0tML/TeGi79Yk5Xq8CgCFtTfiGaaq1gsXblQ5ZW9CCgQLGAJix LDHA/ahAFaMb6sEOT7odN2wxI1gvyBWjqalUINtYkfW1QE4c1s31Dt9DmFuUqZtc LHGoTiQoicRqdH1ho/Y5LOEbEgpf2qSJZqzrEYxbCTzihICibqAZBLpsXqpEKj5v NbIheq5eZpxw4fxvbIwb2P51p4/vIDieNZd425xK/3RoyxbbvOE1Lmqg1hOtpKC3 wVdDE5IJDRgA23lnqtKjtMBXO5m1NCOEi+drHpuBlSNR5iJTdVVk6qRHSP5Q== 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=fm3; t= 1747786913; x=1747873313; bh=bU7Gs9vp4G9j6qz0PDGWXjm/80iefa+rtyY 3v7Bn72w=; b=L1vkOdUZxYfe+maoZUzoJNp8UGsT2xOg4kX/E6Wj0sPtVlvOkri Owfr7ZPyul35e/XUXpwClqgLIEVHilun6m4oQ5AZLx+DcOSSg4zRzRR0E8LRpBQ1 1ZBesUxUQ/pswhR+Qxz1nPMi+R3eh9YDe3X+zxLzNbsECyV43YZjrkV6amgyPEi9 gyl9gr5961r5uZ5Lzr9dumsEdXs0h+vgeAMaAW5il//9rfDvED6gEpgygVOdPMXy CO2+J5Ii/hmruo2IQggUxkei99nJ5E+dds1Y1hZXZo8x8wuhlUamEmBfBN9GmJR5 LGMtwR+4TUU1Z2Ef6i6s1f4rEbudND/vKbw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddtgdduieefucdltddurdegfedvrddttd dmucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgf nhhsuhgsshgtrhhisggvpdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttd enucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrhhlucfvnfffucdlfeehmden ucfjughrpeffhffvvefukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefoihgthh grvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqhhuihgvrhdrgiihiieqnecu ggftrfgrthhtvghrnhepgeffjeevgfevuddvjedtvddtieejheduueelvddufedtgfefje dvkeevkeeivddvnecuffhomhgrihhnpehpohhsthhgrhgvshhqlhdrohhrghenucevlhhu shhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlse hprghquhhivghrrdighiiipdhnsggprhgtphhtthhopedutddpmhhouggvpehsmhhtphho uhhtpdhrtghpthhtohepphgrvhgvlhdrshhtvghhuhhlvgesghhmrghilhdrtghomhdprh gtphhtthhopegsrhhutggvsehmohhmjhhirghnrdhushdprhgtphhtthhopehmrghrtgho shesfhdutddrtghomhdrsghrpdhrtghpthhtohepjhhirghnrdhunhhivhgvrhhsrghlih hthiesghhmrghilhdrtghomhdprhgtphhtthhopeelvghrthhhrghlihhonheisehgmhgr ihhlrdgtohhmpdhrtghpthhtoheplhgruhhrvghniidrrghlsggvsegthigsvghrthgvtg drrghtpdhrtghpthhtohepvghrseigshegrghllhdrnhhlpdhrtghpthhtoheprghmihht rdhkrghpihhlrgduieesghhmrghilhdrtghomhdprhgtphhtthhopehrvghmihdrughuvh grlhestghhvghophhsrdhfrh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 20 May 2025 20:21:49 -0400 (EDT) Date: Wed, 21 May 2025 09:21:42 +0900 From: Michael Paquier To: Pavel Stehule Cc: Bruce Momjian , Marcos Pegoraro , jian he , Dmitry Dolgov <9erthalion6@gmail.com>, Laurenz Albe , Erik Rijkers , Amit Kapila , DUVAL REMI , PostgreSQL Hackers Subject: Re: Re: proposal: schema variables Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="foiHgcmvQry6kJhL" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --foiHgcmvQry6kJhL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, May 20, 2025 at 10:28:31PM +0200, Pavel Stehule wrote: > This topic is difficult, because there is no common solution. SQL/PSM is > almost dead. T-SQL (and MySQL) design is weak and cannot be used for > security. > Oracle's design is joined with just one environment. And although almost > all widely used databases have supported session variables for decades, no > one design > is perfect. Proposed design is not perfect too (it introduces possible > ambiguity) , but I think it can support most wanted use cases (can be > enhanced in future), > and it is consistent with Postgres. There are more ways to reduce risk of > unwanted ambiguity to zero. But it increases the size of the patch. One thing that I keep hearing about this feature is that this would be really helpful for migration from Oracle to PostgreSQL, helping a lot with rewrites of pl/pgsql functions. There is one page on the wiki about private variables, dating back to 2016: https://wiki.postgresql.org/wiki/CREATE_PRIVATE_VARIABLE Perhaps it would help to summarize a bit the pros and cons of existing implementations to drive which implementation would be the most suited on a wiki page? The way standards are defined is by overwriting existing standards, and we don't have one in the SQL specification. It's hard to say if there will be one at some point, but if the main SQL products around the world have one, it pretty much is a point in favor of having a standard. Another possible angle that could be taken is to invest in a proposal for the SQL committee to consider, forcing an actual standard that PostgreSQL could rely on rather than having one behavior implemented to have it standard-incompatible a few years after. And luckily, we have Vik Fearing and Peter Eisentraut in this community who invest time and resources in this area. FWIW, I do agree with the opinion that if you want to propose rebased versions of this patch set on a periodic basis, you are free to do so. This is the core concept of an open community. In terms of my committer time, I'm pretty much already booked in terms of features planned for the next release, so I guess that I won't be able to invest time on this thread. Just saying. I know that this patch set has been discussed at FOSDEM at some point, so others may be able to comment more about that. That's just one opinion among many others. -- Michael --foiHgcmvQry6kJhL Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmgtHJYACgkQnvQgOdby QH3joxAAjV49Gw/dBn9DQalssKKMNj4kZiqAkL3LACRoCRQoFk+zRASzrPTvp/vB GZUD4tYQSrD6rJSRNjA8YBfZ91IZ2X95wwN1KJdM21MCv12CAXTAoL6CNYE1+G1G ABASnTCcqarwh8WRjECOpJMERxIGi2gpF6gz0O1l23sMT7if58+5G9lfj0toc9eB DUvwVQ5r9IgpUngzcGa0MqTCGgA6dIXTnDWScKH88gyKBoWoEJWd9sWIheFuwALE DshnG/2f4drxS0WxeaDr6VZ5cRMRB+xeKGIP1ge4Vzg1dx3tJIsoS0BGoZ8vFoR5 SlSzVsn3AYykueNGSsgjoES2zjnHGnh/rBtxeElBdcVF1B0i/zpJeI+IyqMB4AbH JS8JR8XswGsc6gE+YnH0+3Iy7SAZjxo9H4BwQrch8ewjvhqQAV8z7KtsfKUWs10h Y09nRf3YHrSLY/1DHbdL+57uciG0IFZkIPydDE7A7tifsNzwJ6av+IdBDjtS+DFW 7bw1rt3hxhac9wmB0LNVZhngPMcYmiX72ETDLPbXCRjM6J8ggt1krsQHrlUOdJiX HTNVMNa9Kq1YTdqErsQKIhUyEow+b0zyhxs073wqjTuDpwe1mUbSSHwUK4kt+KaF Bm7dmgvu4pgUhrUFzg7KaJ/LWPnU2ikXAny7Fu3IAHXE9djImhc= =o2UX -----END PGP SIGNATURE----- --foiHgcmvQry6kJhL--