Re: proposal: schema variables

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: Erik Rijkers <er(at)xs4all(dot)nl>, Michael Paquier <michael(at)paquier(dot)xyz>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, DUVAL REMI <REMI(dot)DUVAL(at)cheops(dot)fr>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: proposal: schema variables
Date: 2024-09-03 11:41:31
Message-ID: CAFj8pRBvUwfs96MX2_=unHQ107diUOK4S_WD=E4XBXkpXG3VjA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

po 2. 9. 2024 v 16:00 odesílatel Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
napsal:

> On Thu, 2024-08-29 at 19:33 +0200, Pavel Stehule wrote:
> > > > > > > + /*
> > > > > > > + * Although svar is freshly validated in this point, the
> svar->is_valid can
> > > > > > > + * be false, due possible accepting invalidation message
> inside domain
> > > > > > > + * check. Now, the validation is done after lock, that
> can also accept
> > > > > > > + * invalidation message, so validation should be
> trustful.
> > > > > > > + *
> > > > > > > + * For now, we don't need to repeat validation. Only
> svar should be valid
> > > > > > > + * pointer.
> > > > > > > + */
> > > > >
> > > > > This comment is related to assertions. Before I had there
> `Assert(svar->is_valid)`,
> > > > > because I expected it. But it was not always true. And although it
> is true,
> > > > > we don't need to validate a variable, because at this moment, the
> variable
> > > > > should be locked, and then we can return content safely.
> > > >
> > > > I guess my main problem is the word "trustful". I don't recognize
> that word.
> > > > Perhaps you can reword the comment along the lines of your above
> explanation.
> > >
> > >
> > > I'll try to change it
> >
> > is this better
> >
> > <-->/*
> > <--> * Although svar is freshly validated in this point, the
> svar->is_valid can
> > <--> * be false, due possible accepting invalidation message inside
> domain
> > <--> * check. But now, the variable, and all dependencies are locked, so
> we
> > <--> * don't need to repeat validation.
> > <--> */
>
> Much better.
>
> Here is an improved version:
>
> Although "svar" is freshly validated in this point, svar->is_valid can
> be false, if an invalidation message ws processed during the domain
> check.
> But the variable and all its dependencies are locked now, so we don't
> need
> to repeat the validation.
>
>

merged

thank you

Regards

Pavel

> Yours,
> Laurenz Albe
>

Attachment Content-Type Size
v20240903-0017-expression-with-session-variables-can-be-inlined.patch text/x-patch 4.2 KB
v20240903-0020-pg_restore-A-variable.patch text/x-patch 2.8 KB
v20240903-0019-transactional-variables.patch text/x-patch 39.2 KB
v20240903-0016-plpgsql-implementation-for-LET-statement.patch text/x-patch 14.2 KB
v20240903-0018-this-patch-changes-error-message-column-doesn-t-exis.patch text/x-patch 29.1 KB
v20240903-0015-allow-parallel-execution-queries-with-session-variab.patch text/x-patch 11.9 KB
v20240903-0014-allow-read-an-value-of-session-variable-directly-fro.patch text/x-patch 13.3 KB
v20240903-0013-Implementation-of-NOT-NULL-and-IMMUTABLE-clauses.patch text/x-patch 35.6 KB
v20240903-0012-Implementation-of-DEFAULT-clause-default-expressions.patch text/x-patch 33.6 KB
v20240903-0011-Implementation-ON-TRANSACTION-END-RESET-clause.patch text/x-patch 14.6 KB
v20240903-0009-PREPARE-LET-support.patch text/x-patch 7.4 KB
v20240903-0008-EXPLAIN-LET-support.patch text/x-patch 8.3 KB
v20240903-0010-implementation-of-temporary-session-variables.patch text/x-patch 39.3 KB
v20240903-0007-GUC-session_variables_ambiguity_warning.patch text/x-patch 13.9 KB
v20240903-0006-plpgsql-tests.patch text/x-patch 16.9 KB
v20240903-0005-memory-cleaning-after-DROP-VARIABLE.patch text/x-patch 22.4 KB
v20240903-0004-DISCARD-VARIABLES.patch text/x-patch 9.6 KB
v20240903-0003-function-pg_session_variables-for-cleaning-tests.patch text/x-patch 4.6 KB
v20240903-0002-Storage-for-session-variables-and-SQL-interface.patch text/x-patch 147.0 KB
v20240903-0001-Enhancing-catalog-for-support-session-variables-and-.patch text/x-patch 132.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andreas Karlsson 2024-09-03 12:09:04 Re: JIT: The nullness of casetest.value can be determined at the JIT compile time.
Previous Message Zhijie Hou (Fujitsu) 2024-09-03 11:28:59 RE: Collect statistics about conflicts in logical replication