public inbox for [email protected]  
help / color / mirror / Atom feed
From: Pavel Stehule <[email protected]>
To: Michael Paquier <[email protected]>
To: Peter Eisentraut <[email protected]>
Cc: Bruce Momjian <[email protected]>
Cc: Marcos Pegoraro <[email protected]>
Cc: jian he <[email protected]>
Cc: Dmitry Dolgov <[email protected]>
Cc: Laurenz Albe <[email protected]>
Cc: Erik Rijkers <[email protected]>
Cc: Amit Kapila <[email protected]>
Cc: DUVAL REMI <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: Re: proposal: schema variables
Date: Wed, 21 May 2025 07:49:34 +0200
Message-ID: <CAFj8pRChvU6-ANJD_G=3+zfou-ADu05oxfCnbXFgtQhyWMggwg@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CAFj8pRC_2tHski1K4hUMZm0+T4y7na4d8hwgMMF7Y0MXhfUhbg@mail.gmail.com>
	<CAB-JLwaOdMQN838Fy2r2qZLTExfJp0zcjQjmOFVRXhW_-uDNVw@mail.gmail.com>
	<CAFj8pRArtw+Qqzk+Zf2NxjgO=paCBdc54eEma+MsVwtx3j7Atg@mail.gmail.com>
	<CAFj8pRAK_8ym1J=SAdin-vtL0PAachXgjWgU3QrhzinRdBX2sw@mail.gmail.com>
	<CAFj8pRAx-Gb9Ux825cxGNm38qQUOrij1GY6erPRaQ=cpqfiX7g@mail.gmail.com>
	<CAFj8pRCEjG005L=1vGbir-odYdcYxByOAeFVJ_K9eRcRF=MbNQ@mail.gmail.com>
	<[email protected]>
	<CAB-JLwY2-Hm_SYbj2td_VKuU8awCwgDr-sOtjHRE2C-Sgg_pFg@mail.gmail.com>
	<[email protected]>
	<CAFj8pRABfnPMJCzqLKp11q-FhpdteTcAG8Bqm6SOoe-RA2uxcA@mail.gmail.com>
	<[email protected]>

st 21. 5. 2025 v 2:21 odesílatel Michael Paquier <[email protected]>
napsal:

> 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
>
>
I wrote mail

https://www.postgresql.org/message-id/[email protected]...

and there is another wiki page
https://wiki.postgresql.org/wiki/Variable_Design



> 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.
>

Although it is  maybe a peccant idea - I can imagine two different
implementations of server side session variables with different syntaxes
(and different advantages and disadvantages, and different use cases). The
implementations are not going against, but we should to accept
fact, so one feature is implemented twice. We should choose just one, that
will be implemented first. Proposed helps with migration from
PL/SQL.


>
> 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.
>

Theoretically the proposed design is a subset of implementation from DB2 -
I designed it without knowledge of this DB2 feature. But without
introduction of concept of modules (that is partially redundant to
schemas), this design is very natural and I am very sure, so there is not
another way, how to design it. We can ask Peter or Vik about real
possibilities in this area. I have not any information from this area, just
I haven't seen the changes in SQL/PSM for decades, so I didn't think  about
it.



> 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.
>

thank you for an info


> 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
>


view thread (439+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Re: proposal: schema variables
  In-Reply-To: <CAFj8pRChvU6-ANJD_G=3+zfou-ADu05oxfCnbXFgtQhyWMggwg@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox