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