| От | Craig Ringer |
|---|---|
| Тема | Re: Sequences change in a rolled-back transactions |
| Дата | |
| Msg-id | 49B53977.2070706@postnewspapers.com.au обсуждение |
| Ответ на | Re: Sequences change in a rolled-back transactions (Alvaro Herrera <alvherre@commandprompt.com>) |
| Список | pgsql-general |
Alvaro Herrera wrote: > Erwin Moller wrote: > >> I thought a transaction that is rolled back, rolls back *everything* >> done in that transaction. >> Appearantly sequences are not included. > > Yes. This is actually a desirable property, because it allows sequences > to work fine in concurrent scenarios (which are, after all, the whole > point of sequences). > > If you actually need an incremental number with no gaps (which is rare > but not unseen), you need to use some other mechanism, which will > probably involve a lock to prevent concurrency. If so, search the list archives for "gapless sequence". You'll see lots of explanations of options and of the problems with them. -- Craig Ringer
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера