Re: [SQL] begin/end/abort work for sequences?
От | Kyle Bateman |
---|---|
Тема | Re: [SQL] begin/end/abort work for sequences? |
Дата | |
Msg-id | 377B7A2F.26209427@actarg.com обсуждение исходный текст |
Ответ на | Re: [SQL] begin/end/abort work for sequences? (Bruce Momjian <maillist@candle.pha.pa.us>) |
Ответы |
Re: [SQL] begin/end/abort work for sequences?
Re: [SQL] begin/end/abort work for sequences? |
Список | pgsql-sql |
Bruce Momjian wrote: <blockquote type="CITE">> > The sequence po_seq is advancing to the next value even though the<br />> > transaction was aborted. If I put other things like updates, inserts, etc. <br />> > inside thetransaction, they seem to be rolled back OK, but not the <br />> > update of the sequence. <br />> > <br />>> Am I doing something wrong? <br />> <br />> No. I can't explain you why but AFAIK sequences don't rollback.<p>If we rolled back sequence numbers, we would have to lock the table <br />until the transaction commited or wasrolled back. That is too much <br />locking so was not worth it. <br /> </blockquote><p><br />That seems like a prettybig thing to sacrifice. Did sequence locking work before 6.5? It was my impression that it did. <p>Do you know ifthere is a workaround? In my particular situation, it is critical that all instances of the sequence actually get used. If a transaction is aborted, I lose an instance and everything gets messed up. <pre>-- ---------------------------------------------------- Kyle Bateman President, Action Target Inc. "Viva Yo!" kyle@actarg.com (801)377-8033x101 ----------------------------------------------------</pre>
В списке pgsql-sql по дате отправления: