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

From Andrew Sullivan
Subject Re: Column with recycled sequence value
Date
Msg-id 20050113194900.GB31858@phlogiston.dyndns.org
Whole thread Raw
In response to Column with recycled sequence value  (KÖPFERL Robert <robert.koepferl@sonorys.at>)
Responses Re: Column with recycled sequence value  (PFC <lists@boutiquenumerique.com>)
Re: Column with recycled sequence value  (Greg Stark <gsstark@mit.edu>)
List pgsql-sql
On Thu, Jan 13, 2005 at 06:08:20PM +0100, KÖPFERL Robert wrote:
> Hi,
> 
> suppose I have a let's say heavy used table. There's a column containing
> UNIQUE in4
> values. The data type musn't exceed 32-Bit. Since however the table is heavy
> used 2^32 will be reached soon and then? There are far less than 4G-records
> saved thus these values may be reused. How can this be accomplished?

You can set the sequence up to cycle (so once it gets to the end, it
wraps around to the beginning again).  The keyword is CYCLE at CREATE
SEQUENCE time.  It defaults to NO CYCLE.

One potential problem, of course, are collisions on the table,
because some value wasn't cleared out.  It sounds like you don't have
that problem though.

A

-- 
Andrew Sullivan  | ajs@crankycanuck.ca
The plural of anecdote is not data.    --Roger Brinner


pgsql-sql by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: Column with recycled sequence value
Next
From: Scott Marlowe
Date:
Subject: Re: Column with recycled sequence value