Re: Bug?

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: Bug?
Дата
Msg-id 20011115145844.F10930-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на Re: Bug?  ("Andrew G. Hammond" <drew@xyzzy.dhs.org>)
Список pgsql-general
> Is this correct behaviour?  ACID compliant?  The argument in it's favour it
> pretty obvious: if you never go backwards then you'll never get an accidental
> duplication as follows:
>
> t1 BEGIN; SELECT nextval('test_id_seq')    # 1
> t2 SELECT nextval('test_id_seq')        # 2
> t1 ROLLBACK                 # test_id_seq decremented
> t3 SELECT nextval('test_id_seq')        # 2
>
> However wouldn't locking the sequence be more proper behaviour?

That's the intended behavior.  Sequences aren't defined to give sequential
values, merely unique ones across their output set.  The point is to
prevent two insert transactions from blocking on each other trying to get
the sequence value.




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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Delete performance
Следующее
От: Doug McNaught
Дата:
Сообщение: Re: Bug?