Joe Conway <mail@joeconway.com> writes:
> Tom Lane wrote:
>> 1. Where is the cleanest place to call SetQuerySnapshot() for utility
>> statements that need it?
> Without looking at it too closely, I would think postgres.c would be best,
> unless there is a legit reason for a utility statement to *not* want
> SetQuerySnapshot called.
Actually, there are a number of past threads concerned with whether we
are doing SetQuerySnapshot in the right places --- eg, should it occur
between statements of a plplgsql function? Right now it doesn't, but
maybe it should. In any case I have a note that doing SetQuerySnapshot
for COPY OUT in utility.c is a bad idea, because it makes COPY OUT act
differently from any other statement, when used inside a function: it
*will* change the query snapshot, where nothing else does. So I had
been thinking of pulling it out to postgres.c anyway. I will do that.
>> 2. Would it be a good idea to change CopyQuerySnapshot to elog(ERROR)
>> instead of silently creating a snapshot when none has been made?
> Is an assert appropriate?
Works for me.
regards, tom lane