Re: Where to call SetQuerySnapshot - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Where to call SetQuerySnapshot
Date
Msg-id 2583.1034092895@sss.pgh.pa.us
Whole thread Raw
In response to Re: Where to call SetQuerySnapshot  (Joe Conway <mail@joeconway.com>)
Responses Re: Where to call SetQuerySnapshot  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
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


pgsql-hackers by date:

Previous
From: "Curtis Faith"
Date:
Subject: Re: Analysis of ganged WAL writes
Next
From: "Zeugswetter Andreas SB SD"
Date:
Subject: Re: Analysis of ganged WAL writes