Re: confusing comment in tqual.c

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: confusing comment in tqual.c
Дата
Msg-id 2330.1158336710@sss.pgh.pa.us
обсуждение исходный текст
Ответ на confusing comment in tqual.c  (Gregory Stark <stark@enterprisedb.com>)
Список pgsql-hackers
Gregory Stark <stark@enterprisedb.com> writes:
> I'm reading the code in tqual.c and find that this comment doesn't seem to
> match the code. CommandId always seems to be compared with >= or <= rather
> than equality as the comment says.

Yeah, you're right, the comment seems to be written on the assumption
that it's not possible to see cmin or cmax > curcid ... but that is
possible given sufficiently bizarre programming (eg, query fires a
function or trigger that updates the table again while outer query is
still scanning).  The actual rule for "now" is that a change made in the
current transaction is considered to have taken effect if its cmin or
cmax is strictly less than the current command's CID.

(Hmm ... actually, given the limited ways in which SnapshotNow is used,
I guess it's possible that indeed this can never happen.  The code is
made to be parallel to similar tests in SatisfiesSnapshot, which
definitely can see the sort of scenario mentioned above.)
        regards, tom lane


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: New version of money type
Следующее
От: Andrew - Supernews
Дата:
Сообщение: Re: New version of money type