pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <maillist@candle.pha.pa.us>
To: Kyle Bateman <kyle@actarg.com>
Cc: pgsql-sql@postgreSQL.org, "[Jos_] Soares" <jose@sferacarta.com>
Subject: Re: [SQL] begin/end/abort work for sequences?
Date: Thu, 1 Jul 1999 11:30:47 -0400 (EDT)
Message-ID: <199907011530.LAA02443@candle.pha.pa.us> (raw)
In-Reply-To: <377B7A2F.26209427@actarg.com>

> > 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



view thread (7+ messages)  latest in thread

Message-ID: <199907011530.LAA02443@candle.pha.pa.us>
Permalink:  ../199907011530.LAA02443@candle.pha.pa.us/
Also on:    postgresql.org/message-id/199907011530.LAA02443@candle.pha.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: maillist@candle.pha.pa.us, kyle@actarg.com, jose@sferacarta.com
  Subject: Re: [SQL] begin/end/abort work for sequences?
  In-Reply-To: <199907011530.LAA02443@candle.pha.pa.us>
  References: <377B7A2F.26209427@actarg.com> <199907011530.LAA02443@candle.pha.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox