Re: Schema variables - new implementation for Postgres 15

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
Cc: Sergey Shinderuk <s(dot)shinderuk(at)postgrespro(dot)ru>, Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, Julien Rouhaud <rjuju123(at)gmail(dot)com>, dean(dot)a(dot)rasheed(at)gmail(dot)com, er(at)xs4all(dot)nl, joel(at)compiler(dot)org, Dmitry Dolgov <9erthalion6(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Schema variables - new implementation for Postgres 15
Date: 2023-06-22 17:59:30
Message-ID: CAFj8pRB3j_J0c-8r9hfYnY-dKmFq3f7RxDmoQEPeoQndYdawVQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

čt 30. 3. 2023 v 15:40 odesílatel Peter Eisentraut <
peter(dot)eisentraut(at)enterprisedb(dot)com> napsal:

> On 30.03.23 10:49, Pavel Stehule wrote:
> > If I reorganize the patch to the following structure, can be it useful
> > for you?
> >
> > 1. really basic functionality (no temporary variables, no def
> > expressions, no memory cleaning)
> > SELECT variable
> > LET should be supported + doc, + related tests.
> >
> > 2. support for temporary variables (session, transaction scope),
> > memory cleaning at the end of transaction
> >
> > 3. PL/pgSQL support
> > 4. pg_dump
> > 5. shadowing warning
> > 6. ... others ...
>

I am sending a refactorized patch. Mainly I rewrote memory cleaning - now
it should be more robust and more simple (no more mem alloc in sinval
handler). Against the previous patch, only the syntax "LET var = DEFAULT"
is not supported. I don't think it should be supported now. These patches
are incremental - every patch contains related doc, regress tests and can
be tested incrementally.

New organization

1. basic CREATE VARIABLE, DROP VARIABLE, GRANT, REVOKE, ALTER, pg_dump
2. basic SELECT var, LET var = value
3. DISCARD VARIABLES
4. cleaning memory used by dropped variables
5. temporary variables + ON COMMIT DROP clause support
6. ON TRANSACTION END RESET clause support
7. DEFAULT expr clause support
8. support NOT NULL and IMMUTABLE clauses
9. use message "column or variable doesn't exists" instead "column doesn't
exists"

Regards

Pavel

>
> That seems like an ok approach. The pg_dump support should probably go
> into the first patch, so it's self-contained.
>

Attachment Content-Type Size
v20230622-0009-this-patch-changes-error-message-column-doesn-t-exis.patch text/x-patch 29.1 KB
v20230622-0006-Implementation-ON-TRANSACTION-END-RESET-clause.patch text/x-patch 14.7 KB
v20230622-0007-Implementation-of-DEFAULT-clause-default-expressions.patch text/x-patch 31.0 KB
v20230622-0005-implementation-of-temporary-session-variables.patch text/x-patch 36.9 KB
v20230622-0008-Implementation-of-NOT-NULL-and-IMMUTABLE-clauses.patch text/x-patch 36.2 KB
v20230622-0003-DISCARD-VARIABLES.patch text/x-patch 9.2 KB
v20230622-0004-memory-cleaning-after-DROP-VARIABLE.patch text/x-patch 21.9 KB
v20230622-0002-Storage-for-session-variables-and-SQL-interface.patch text/x-patch 209.8 KB
v20230622-0001-Enhancing-catalog-for-support-session-variables-and-.patch text/x-patch 138.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2023-06-22 18:08:54 Re: Remove deprecation warnings when compiling PG ~13 with OpenSSL 3.0~
Previous Message Joel Jacobson 2023-06-22 17:52:10 Re: Do we want a hashset type?