Re: sequence numbers under pg concurrence model

Поиск
Список
Период
Сортировка
От Frank Heikens
Тема Re: sequence numbers under pg concurrence model
Дата
Msg-id 1BFCE64D-F2CD-40DF-BAAA-EECDA5FC3F5D@mac.com
обсуждение исходный текст
Ответ на sequence numbers under pg concurrence model  (scorpdaddy@hotmail.com <scorpdaddy@hotmail.com>)
Список pgsql-admin

Op 24 feb 2011, om 20:49 heeft scorpdaddy@hotmail.com het volgende geschreven:

What is the expected behaviour of sequence numbers under pg concurrence model?

From the manual:
Important: To avoid blocking concurrent transactions that obtain numbers from the same sequence, a nextval operation is never rolled back; that is, once a value has been fetched it is considered used, even if the transaction that did the nextval later aborts. This means that aborted transactions might leave unused "holes" in the sequence of assigned values. setval operations are never rolled back, either.



E.g.  Uncommitted transaction 1 in progress has inserted 5 tuples into table foo.  Meanwhile uncommitted transaction 2 in progress inserts 100 tuples into table foo.  If the sequence number for the pk started at 1000 before these transactions, what are the sequence numbers for transaction 1, 2, and the final sequence number if they both commit?  One rollback's?  Both rollback? One hangs open while the other commits?  One hang and one rollback's?


Frank Heikens



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

Предыдущее
От: scorpdaddy@hotmail.com
Дата:
Сообщение: sequence numbers under pg concurrence model
Следующее
От: Scott Mead
Дата:
Сообщение: Re: transaction wraparound