Tom Lane wrote:
> Andrew Dunstan <andrew@dunslane.net> writes:
>
>> I don't understand that phrase "call SPI with the right arguments for
>> the type of function you're currently in". What calls that we make from
>> plperl code would have different arguments depending on the volatility
>> of the function?
>>
>
> eg, in plperl_spi_exec,
>
> spi_rv = SPI_execute(query, current_call_data->prodesc->fn_readonly,
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> limit);
>
>
OK, but won't that automatically supply the value from the function
called from postgres, which will be the right thing? i.e. if postgres
calls S which direct-calls V which calls SPI_execute(), the value of
current_call_data->prodesc->fn_readonly in the call above will be
supplied from S, not V, since S will be at the top of the plperl call stack.
cheers
andrew