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-08-01 22:02:27
Message-ID: CAFj8pRDQjOYF5yCUzPfAXgeVUUW0qV5XdeoG0mJy2dPrjGNFSQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

čt 1. 8. 2024 v 13:22 odesílatel Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
napsal:

> On Thu, 2024-08-01 at 08:12 +0200, Pavel Stehule wrote:
> > fresh rebase + fix format in doc
>
> Thanks!
>
> I'm curious, but too lazy to build the patch now, so I'm asking:
> what did you do about this error?
>
> > CREATE VARIABLE var AS date;
> > LET var = current_date;
> > PREPARE stmt(date) AS SELECT $1;
> > EXECUTE stmt(var);
> > ERROR: paramid of PARAM_VARIABLE param is out of range
>
> Or does a later patch take care of that?
>

It is working with patch "allow read an value of session variable directly
from expression executor"

It looks very similar to evaluation of parameters of CALL statements.
Without the mentioned patch, the CALL statements don't allow variables as
an argument. I blocked usage of session variables as EXECUTE parameters
until direct access to session variables in expression evaluation is
supported.

Regards

Pavel

> Yours,
> Laurenz Albe
>

Attachment Content-Type Size
v20240801-0018-expression-with-session-variables-can-be-inlined.patch text/x-patch 4.2 KB
v20240801-0017-plpgsql-implementation-for-LET-statement.patch text/x-patch 13.6 KB
v20240801-0021-pg_restore-A-variable.patch text/x-patch 2.8 KB
v20240801-0020-transactional-variables.patch text/x-patch 39.2 KB
v20240801-0019-this-patch-changes-error-message-column-doesn-t-exis.patch text/x-patch 29.1 KB
v20240801-0016-allow-parallel-execution-queries-with-session-variab.patch text/x-patch 11.3 KB
v20240801-0015-allow-read-an-value-of-session-variable-directly-fro.patch text/x-patch 13.5 KB
v20240801-0014-Implementation-of-NOT-NULL-and-IMMUTABLE-clauses.patch text/x-patch 36.0 KB
v20240801-0013-Implementation-of-DEFAULT-clause-default-expressions.patch text/x-patch 33.6 KB
v20240801-0012-Implementation-ON-TRANSACTION-END-RESET-clause.patch text/x-patch 14.6 KB
v20240801-0010-PREPARE-LET-support.patch text/x-patch 7.4 KB
v20240801-0009-EXPLAIN-LET-support.patch text/x-patch 8.3 KB
v20240801-0011-implementation-of-temporary-session-variables.patch text/x-patch 39.3 KB
v20240801-0008-GUC-session_variables_ambiguity_warning.patch text/x-patch 13.9 KB
v20240801-0007-plpgsql-tests.patch text/x-patch 16.9 KB
v20240801-0006-memory-cleaning-after-DROP-VARIABLE.patch text/x-patch 22.4 KB
v20240801-0005-DISCARD-VARIABLES.patch text/x-patch 9.6 KB
v20240801-0004-function-pg_session_variables-for-cleaning-tests.patch text/x-patch 4.6 KB
v20240801-0003-regress-tests.patch text/x-patch 1.8 KB
v20240801-0002-Storage-for-session-variables-and-SQL-interface.patch text/x-patch 146.3 KB
v20240801-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 Alexander Korotkov 2024-08-01 22:51:11 Re: Asymmetric partition-wise JOIN
Previous Message Nathan Bossart 2024-08-01 21:41:18 Re: optimizing pg_upgrade's once-in-each-database steps