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