From: Andrew Sullivan <ajs@crankycanuck.ca>
To: 'pgsql-sql@postgresql.org' <pgsql-sql@postgresql.org>
Subject: Re: Column with recycled sequence value
Date: Thu, 13 Jan 2005 14:49:00 -0500
Message-ID: <20050113194900.GB31858@phlogiston.dyndns.org> (raw)
In-Reply-To: <ED4E30DD9C43D5118DFB00508BBBA76EB1654B@neptun.sonorys.at>
References: <ED4E30DD9C43D5118DFB00508BBBA76EB1654B@neptun.sonorys.at>
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
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: ajs@crankycanuck.ca
Subject: Re: Column with recycled sequence value
In-Reply-To: <20050113194900.GB31858@phlogiston.dyndns.org>
* 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