Re: Where to call SetQuerySnapshot

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: Neil Conway <neilc(at)samurai(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Where to call SetQuerySnapshot
Date: 2002-10-08 16:01:35
Message-ID: 2583.1034092895@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Joe Conway <mail(at)joeconway(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-10-08 16:04:35 Re: inline newNode()
Previous Message Tom Lane 2002-10-08 15:53:52 Re: inline newNode()