Re: sequences vs. transactions

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: sequences vs. transactions
Дата
Msg-id 199905120205.WAA01843@candle.pha.pa.us
обсуждение исходный текст
Ответ на sequences vs. transactions  (Vazsonyi Peter <neko@sp1.szif.hu>)
Ответы Re: [HACKERS] Re: sequences vs. transactions  (Vazsonyi Peter <neko@sp1.szif.hu>)
Список pgsql-hackers
> Hi!
> I found a bug, with $SUBJ - i mean ... so look at this:
> t=> begin;
> BEGIN
> t=> select nextval('some_seq');
> nextval
> -------
>       4
> (1 row)
> t=> rollback;
> ROLLBACK
> t=> select nextval('some_seq');
> nextval
> -------
>       5 <<<< five! and NOT 4 again, but 4 expected i think
> (1 row)
> 
> Or seqences are special case in transations?

Sequence numbers are not re-used like normal transactions.  The reason
for this is that we would have to lock the sequence table for the entire
duration of the transaction until it was committed if we wanted to do
that.


--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


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

Предыдущее
От: Tatsuo Ishii
Дата:
Сообщение: Re: [HACKERS] 6.5 TODO list
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] 6.5 TODO list