Re: Status of plperl inter-sp calling - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: Status of plperl inter-sp calling
Date
Msg-id 4B44B547.2090901@dunslane.net
Whole thread Raw
In response to Re: Status of plperl inter-sp calling  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Status of plperl inter-sp calling
List pgsql-hackers

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


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: patch - per-tablespace random_page_cost/seq_page_cost
Next
From: Tom Lane
Date:
Subject: Re: Status of plperl inter-sp calling