From: Scott Marlowe <smarlowe@g2switchworks.com>
To: Andrew Sullivan <ajs@crankycanuck.ca>
Cc: 'pgsql-sql@postgresql.org' <pgsql-sql@postgresql.org>
Subject: Re: Column with recycled sequence value
Date: Thu, 13 Jan 2005 15:57:04 -0600
Message-ID: <1105653424.24795.111.camel@state.g2switchworks.com> (raw)
In-Reply-To: <20050113214349.GC31858@phlogiston.dyndns.org>
References: <ED4E30DD9C43D5118DFB00508BBBA76EB1654B@neptun.sonorys.at>
<1105649326.24795.99.camel@state.g2switchworks.com>
<20050113211903.GA41687@winnie.fuhr.org>
<1105651913.24795.102.camel@state.g2switchworks.com>
<20050113214349.GC31858@phlogiston.dyndns.org>
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.
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: smarlowe@g2switchworks.com, ajs@crankycanuck.ca
Subject: Re: Column with recycled sequence value
In-Reply-To: <1105653424.24795.111.camel@state.g2switchworks.com>
* 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