Re: vary read_only in SPI calls? or poke at the on-entry snapshot?

Поиск
Список
Период
Сортировка
От Chapman Flack
Тема Re: vary read_only in SPI calls? or poke at the on-entry snapshot?
Дата
Msg-id 5BA5A83A.7000609@anastigmatix.net
обсуждение исходный текст
Ответ на Re: vary read_only in SPI calls? or poke at the on-entry snapshot?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 09/20/18 00:44, Tom Lane wrote:
>> 1. fiddle the loader to always pass read_only => false to SPI calls,
>>    regardless of the volatility of the function it is loading for.
>> 2. leave the loader alone, and adjust install_jar (an infrequent
>>    operation) to do something heretical with its on-entry snapshot.
> 
> I suspect #1 is less likely to have bad side-effects.  But I've not
> done any careful analysis.

Just noticed too: a thing prepared with the SPI_prepare... functions
(which take no read_only or snapshot parameters) later gets executed by
one of the SPI_execute... functions, which do take such parameters.

I assume the analysis and planning take place with reference to some
snapshot---necessarily? right?---(though on a quick skim of the code
I'm not yet sure what snapshot that is or how chosen), but the
parameters accepted by SPI_execute... can lead to a different snapshot
being in effect then.

Is that by design? Does it imply certain caveats I should be careful
about? Does it trigger any amount of replanning?

-Chap


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: [PATCH] Tab completion for ALTER DATABASE … SET TABLESPACE
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: Proposal for disk quota feature