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 469653A5236 for ; Thu, 13 Jan 2005 21:36:25 +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 24024-06 for ; Thu, 13 Jan 2005 21:36:10 +0000 (GMT) Received: from koolancexeon.g2switchworks.com (mail.g2switchworks.com [63.87.162.25]) by svr1.postgresql.org (Postfix) with ESMTP id 93CA83A5ADB for ; Thu, 13 Jan 2005 21:31:54 +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:31:54 -0600 Subject: Re: Column with recycled sequence value From: Scott Marlowe To: Michael Fuhr Cc: =?ISO-8859-1?Q?K=D6PFERL?= Robert , "'pgsql-sql@postgresql.org'" In-Reply-To: <20050113211903.GA41687@winnie.fuhr.org> References: <1105649326.24795.99.camel@state.g2switchworks.com> <20050113211903.GA41687@winnie.fuhr.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Message-Id: <1105651913.24795.102.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:31:54 -0600 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.002 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200501/89 X-Sequence-Number: 19877 On Thu, 2005-01-13 at 15:19, Michael Fuhr wrote: > On Thu, Jan 13, 2005 at 02:48:47PM -0600, Scott Marlowe wrote: > > On Thu, 2005-01-13 at 11:08, K=C3=96PFERL Robert wrote: >=20 > > > suppose I have a let's say heavy used table. There's a column contain= ing > > > UNIQUE in4 > > > values. The data type musn't exceed 32-Bit. Since however the table i= s heavy > > > used 2^32 will be reached soon and then? There are far less than 4G-r= ecords > > > saved thus these values may be reused. How can this be accomplished? > > >=20 > > > I already defined a sequence but then? > >=20 > > Redefine it as a bigserial? >=20 > That would violate the 32-bit requirement since bigserial would > make the field a bigint (64 bits). Or am I missing something? I wasn't sure if that was a limitation he was facing due to business rules or if he was referring to the limit in postgresql. Any method that tries to reuse sequence numbers is a bad idea (TM) and to be avoided, so my point in asking was if the user didn't know about bigserial / bigint.