Re: proposal: schema variables - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: proposal: schema variables
Date
Msg-id CAFj8pRDQjOYF5yCUzPfAXgeVUUW0qV5XdeoG0mJy2dPrjGNFSQ@mail.gmail.com
Whole thread Raw
In response to Re: proposal: schema variables  (Laurenz Albe <laurenz.albe@cybertec.at>)
Responses Re: proposal: schema variables
List pgsql-hackers


čt 1. 8. 2024 v 13:22 odesílatel Laurenz Albe <laurenz.albe@cybertec.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

pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: optimizing pg_upgrade's once-in-each-database steps
Next
From: Alexander Korotkov
Date:
Subject: Re: Asymmetric partition-wise JOIN