Re: Column with recycled sequence value - Mailing list pgsql-sql

From Scott Marlowe
Subject Re: Column with recycled sequence value
Date
Msg-id 1105653424.24795.111.camel@state.g2switchworks.com
Whole thread Raw
In response to Re: Column with recycled sequence value  (Andrew Sullivan <ajs@crankycanuck.ca>)
Responses Re: Column with recycled sequence value
List pgsql-sql
On Thu, 2005-01-13 at 15:43, Andrew Sullivan wrote:
> On Thu, Jan 13, 2005 at 03:31:54PM -0600, Scott Marlowe wrote:
> > Any method that tries to reuse sequence numbers is a bad idea (TM) and
> 
> Why?  I can think of a dozen cases where it can be useful.  It just
> depends on the application.

The usual, if it's a PK of a FK relationship it's possible to have an
orphaned set at some point pointing back to it, race conditions on
trying to find a reusable sequence number, and the poor performance
needed to lock it to reuse it.

What cases are you thinking of?  I've seen some very limited ones, like
using a short range for managing a queue, but that avoids a lot of the
performance issues since it's a small set you're trundling through to
find the next one available.  But they're not that common, and most of
the time someone is thinking of doing so it's because a boss who doesn't
get it wants a pretty list with no holes in the sequence or something
equally silly.


pgsql-sql by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: Column with recycled sequence value
Next
From: Andrew Sullivan
Date:
Subject: Re: Column with recycled sequence value