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

From Tom Lane
Subject Re: Status of plperl inter-sp calling
Date
Msg-id 3057.1262794478@sss.pgh.pa.us
Whole thread Raw
In response to Re: Status of plperl inter-sp calling  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: Status of plperl inter-sp calling  (Andrew Dunstan <andrew@dunslane.net>)
Re: Status of plperl inter-sp calling  (Garick Hamlin <ghamlin@isc.upenn.edu>)
List pgsql-hackers
Andrew Dunstan <andrew@dunslane.net> writes:
> Tom Lane wrote:
>> spi_rv = SPI_execute(query, current_call_data->prodesc->fn_readonly,
>>                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

> OK, but won't that automatically supply the value from the function 
> called from postgres, which will be the right thing?

My point was that that is exactly the wrong thing.  If I have a function
declared stable, it must not suddenly start behaving as volatile because
it was called from a volatile function.  Nor vice versa.

Now as I mentioned upthread, there might be other ways to get the
correct value of the readonly parameter.  One that comes to mind is
to somehow attach it to the spi call "at compile time", whatever that
means in the perl world.  But you can't just have it be determined by
the outermost active function call.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Status of plperl inter-sp calling
Next
From: Bruce Momjian
Date:
Subject: Re: pg_migrator issues