Re: Nested transactions and tuple header info

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Nested transactions and tuple header info
Дата
Msg-id 23799.1086184348@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Nested transactions and tuple header info  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: Nested transactions and tuple header info  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
Re: Nested transactions and tuple header info  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Tom Lane wrote:
>> This is exactly the same argument as not being able to overwrite cmin.

> Basically the phantom xid's are a shorthand for saying the tuple was
> created by xid1 and deleted by xid2, both part of the same main
> transaction.

> A cursor looking at the rows has to recognize the xid is a phantom (via
> pg_subtrans) and look up the creation xid.

You still don't see the point.  Consider
BEGIN;DECLARE CURSOR c1 FOR SELECT * FROM a ...;INSERT INTO a VALUES(...);    -- call this row xDECLARE CURSOR c2 FOR
SELECT* FROM a ...;BEGIN;DELETE FROM a WHERE ...;    -- assume this deletes row xROLLBACK;FETCH FROM c1;            --
mustNOT see row xFETCH FROM c2;            -- must see row x
 

AFAICS your proposal does not support this.  The two cursors' snapshots
will differ only in the recorded current-cid for the outer transaction.
If the subtrans has overwritten xmin/cmin, there is no way to make that
decision correctly.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: ACLs versus ALTER OWNER
Следующее
От: Shridhar Daithankar
Дата:
Сообщение: Re: Converting postgresql.conf parameters to kilobytes