X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 53AD53A5E02 for ; Thu, 13 Jan 2005 21:57:12 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 29869-04 for ; Thu, 13 Jan 2005 21:57:03 +0000 (GMT) Received: from koolancexeon.g2switchworks.com (mail.g2switchworks.com [63.87.162.25]) by svr1.postgresql.org (Postfix) with ESMTP id 515763A5C51 for ; Thu, 13 Jan 2005 21:57:04 +0000 (GMT) Received: mail.g2switchworks.com 10.10.1.8 from 10.10.1.37 10.10.1.37 via HTTP with MS-WebStorage 6.5.6944 Received: from state.g2switchworks.com by mail.g2switchworks.com; 13 Jan 2005 15:57:04 -0600 Subject: Re: Column with recycled sequence value From: Scott Marlowe To: Andrew Sullivan Cc: "'pgsql-sql@postgresql.org'" In-Reply-To: <20050113214349.GC31858@phlogiston.dyndns.org> References: <1105649326.24795.99.camel@state.g2switchworks.com> <20050113211903.GA41687@winnie.fuhr.org> <1105651913.24795.102.camel@state.g2switchworks.com> <20050113214349.GC31858@phlogiston.dyndns.org> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1105653424.24795.111.camel@state.g2switchworks.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Thu, 13 Jan 2005 15:57:04 -0600 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200501/92 X-Sequence-Number: 19880 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.