Re: "Triggered data change violation", once again

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: "Triggered data change violation", once again
Дата
Msg-id 112.1003970954@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: "Triggered data change violation", once again  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Ответы Re: "Triggered data change violation", once again  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Список pgsql-hackers
Stephan Szabo <sszabo@megazone23.bigpanda.com> writes:
>> I think all we need to do to implement things correctly is to consider a
>> previous event only if both xmin and cmin of the old tuple match the
>> current xact & command IDs, rather than considering it on the basis of
>> xmin alone.

> Are there any things that might update the command ID during the execution
> of the statement from inside functions that are being run?

Functions can run new commands that get new command ID numbers within
the current transaction --- but on return from the function, the current
command number is restored.  I believe rows inserted by such a function
would look "in the future" to us at the outer command, and would be
ignored.

Actually, now that I think about it, the MVCC rules are that tuples with
xmin = currentxact are not visible unless they have cmin < currentcmd.
Not equal to.  This seems to render the entire "triggered data change"
test moot --- I rather suspect that we cannot have such a condition
as old tuple cmin = currentcmd at all, and so we could just yank all
that code entirely.
        regards, tom lane


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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: "Triggered data change violation", once again
Следующее
От: Bill Studenmund
Дата:
Сообщение: Re: Proposed new create command, CREATE OPERATOR CLASS