Re: [GENERAL] xmin increasing within a transaction block?

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: [GENERAL] xmin increasing within a transaction block?
Дата
Msg-id 20171106125330.gcozh4ijjrkn6shq@alvherre.pgsql
обсуждение исходный текст
Ответ на [GENERAL] xmin increasing within a transaction block?  (Luca Ferrari <fluca1978@infinito.it>)
Ответы Re: [GENERAL] xmin increasing within a transaction block?
Re: [GENERAL] xmin increasing within a transaction block?
Список pgsql-general
Luca Ferrari wrote:
> Hi all,
> I suspect this has a trivial explaination, but this is what I'm experiencing:
> 
> > CREATE TABLE foo( i int );
> > BEGIN;
> * > INSERT INTO foo(i) VALUES( 1 );
> * > INSERT INTO foo(i) VALUES( 2 );
> * > SELECT xmin, cmin, xmax, cmax, i FROM foo;
>  xmin | cmin | xmax | cmax | i
> ------+------+------+------+---
>  2466 |    0 |    0 |    0 | 1
>  2467 |    1 |    0 |    1 | 2
> (2 rows)

With this example both rows show the same xmin to me, which is what I'd
expect.

> Why is xmin greater than the current transaction id (and most notably
> not "fixed")?

Something is using subtransactions there.  My first guess would be that
there are triggers with EXCEPTION blocks, but your example doesn't show
any.  Or maybe you have event triggers.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: [GENERAL] Naming conventions for column names
Следующее
От: Vikas Sharma
Дата:
Сообщение: [GENERAL] Postgresql 9.3 service doesn't start on RedHat Linux 6.8