Received: from candle.pha.pa.us (maillist@s5-03.ppp.op.net [209.152.195.67]) by hub.org (8.9.3/8.9.3) with ESMTP id LAA71444 for ; Thu, 1 Jul 1999 11:31:45 -0400 (EDT) (envelope-from maillist@candle.pha.pa.us) Received: (from maillist@localhost) by candle.pha.pa.us (8.9.0/8.9.0) id LAA02443; Thu, 1 Jul 1999 11:30:47 -0400 (EDT) From: Bruce Momjian Message-Id: <199907011530.LAA02443@candle.pha.pa.us> Subject: Re: [SQL] begin/end/abort work for sequences? In-Reply-To: <377B7A2F.26209427@actarg.com> from Kyle Bateman at "Jul 1, 1999 08:24:47 am" To: Kyle Bateman Date: Thu, 1 Jul 1999 11:30:47 -0400 (EDT) CC: pgsql-sql@postgreSQL.org, "[Jos_] Soares" X-Mailer: ELM [version 2.4ME+ PL56 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit > > If we rolled back sequence numbers, we would have to lock the table > > until the transaction commited or was rolled back. That is too much > > locking so was not worth it. > > > > That seems like a pretty big thing to sacrifice. Did sequence locking work before > 6.5? It was my impression that it did. No, sequence numbers of aborted transactions never were saved. > Do you know if there 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. I recommend hand-rolling a sequence number, similar to how the sequence mechanism works, but explicitly lock your sequence table, retrieve the value, and the commit/abort will unlock the table. -- 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, Pennsylvania 19026