pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Modernizing our GUC infrastructure
Date: Tue, 06 Sep 2022 10:05:00 -0400
Message-ID: <3140268.1662473100@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+TgmoZk37L_q8eKgsUYZ_t=Cpd4V7BUxCO=nKtDTitW980tWQ@mail.gmail.com>
References: <2982579.1662416866@sss.pgh.pa.us>
	<CAFj8pRAqiYbZYceC4hqpUVezOE6dq4R8of5XAotaapxJzJo1eg@mail.gmail.com>
	<CAFj8pRBsJkA_Fw6igA+uLmDx3aP71J9cjtd87R=dO64p7qEi7g@mail.gmail.com>
	<3049613.1662442973@sss.pgh.pa.us>
	<CA+TgmoZk37L_q8eKgsUYZ_t=Cpd4V7BUxCO=nKtDTitW980tWQ@mail.gmail.com>

Robert Haas <robertmhaas@gmail.com> writes:
> On Tue, Sep 6, 2022 at 1:43 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> I think there's a good analogy here to temporary tables.  The SQL
>> spec says that temp-table schemas are persistent and database-wide,
>> but what we actually have is that they are session-local.

> Well, I've thought about doing this a few times, but it's a real pain
> in the neck, primarily because we store metadata that needs to be
> per-instantiation in the catalog rows: relfrozenxid, relminmxid, and
> the relation statistics. So I'm not sure "no one has bothered" is
> quite the right way to characterize it. "no one has been able to
> adequately untangle the mess" might be more accurate.

I could agree on "no one has thought it was worth the work".  It could
be made to happen if we were sufficiently motivated, but we aren't.
I believe a big chunk of the reason is that the SQL semantics are not
obviously better than what we have.  And some of the advantages they
do have, like less catalog thrashing, wouldn't apply in the session
variable case.

> I haven't looked at that patch at all, but I would assume that
> variables would have SQL types, and that we would never add GUCs with
> SQL types, which seems like a pretty major semantic difference.

Yeah, I do not think we'd want to extend GUCs beyond the existing
bool/int/float/string cases, since they have to be readable under
non-transactional circumstances.  Having said that, that covers
an awful lot of practical territory.  Schema variables of
arbitrary SQL types sound cool, sure, but how many real use cases
are there that can't be met with the GUC types?

I think a large part of the reason the schema-variables patch
has gone sideways for so many years is that it's an ambitious
overdesign.

			regards, tom lane





view thread (18+ messages)  latest in thread

Message-ID: <3140268.1662473100@sss.pgh.pa.us>
Permalink:  ../3140268.1662473100@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3140268.1662473100@sss.pgh.pa.us

 · 

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: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, robertmhaas@gmail.com, pavel.stehule@gmail.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: Modernizing our GUC infrastructure
  In-Reply-To: <3140268.1662473100@sss.pgh.pa.us>

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

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