From: | Chapman Flack <chap(at)anastigmatix(dot)net> |
---|---|
To: | pgsql-hackers(at)lists(dot)postgresql(dot)org |
Subject: | Re: SPI/backend equivalent of extended-query Describe(statement)? |
Date: | 2018-05-26 00:34:42 |
Message-ID: | 5B08ABA2.7060903@anastigmatix.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 05/25/18 20:07, Andrew Gierth wrote:
> >> with writing a ParserSetupHook that's just a thin wrapper around
> >> parse_variable_parameters ?
>
> That's what I did in pllua-ng. The tricky bit was in arranging to also
> call check_variable_parameters; I considered skipping that part, but
> that seemed like it could be potentially problematic.
>
> https://github.com/pllua/pllua-ng/blob/master/src/spi.c#L266
>
>/*
> * 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.
-Chap
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2018-05-26 00:55:48 | Re: SPI/backend equivalent of extended-query Describe(statement)? |
Previous Message | Andrew Gierth | 2018-05-26 00:07:28 | Re: SPI/backend equivalent of extended-query Describe(statement)? |