Re: SPI/backend equivalent of extended-query Describe(statement)? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: SPI/backend equivalent of extended-query Describe(statement)?
Date
Msg-id 24186.1527296148@sss.pgh.pa.us
Whole thread Raw
In response to Re: SPI/backend equivalent of extended-query Describe(statement)?  (Chapman Flack <chap@anastigmatix.net>)
Responses Re: SPI/backend equivalent of extended-query Describe(statement)?  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
List pgsql-hackers
Chapman Flack <chap@anastigmatix.net> writes:
> On 05/25/18 20:07, Andrew Gierth wrote:
>> /*
>> * GAH. To do parameter type checking properly, we have to install our
>> * own global post-parse hook transiently.
>> */
>> ...
>> PG_TRY();
>> {
>> pllua_spi_prev_parse_hook = post_parse_analyze_hook;
>> post_parse_analyze_hook = pllua_spi_prepare_checkparam_hook;
>> ...
>> PG_CATCH();
>> {
>> post_parse_analyze_hook = pllua_spi_prev_parse_hook;
>> --pllua_spi_prepare_recursion;
>> PG_RE_THROW();
>> ...

> Gah, indeed. Thanks for the heads up. I would never have guessed it'd
> be that fiddly.

Yikes.  That seems pretty unsafe :-(

Obviously, I missed a bet by not folding check_variable_parameters
into the pstate hook mechanism.  It's a bit late to do anything
about that for v11, but I'd favor trying to improve the situation
in v12.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Chapman Flack
Date:
Subject: Re: SPI/backend equivalent of extended-query Describe(statement)?
Next
From: Andrew Gierth
Date:
Subject: Re: SPI/backend equivalent of extended-query Describe(statement)?