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

From Bruno Wolff III
Subject Re: Column with recycled sequence value
Date
Msg-id 20050113201624.GA3418@wolff.to
Whole thread Raw
In response to Column with recycled sequence value  (KÖPFERL Robert <robert.koepferl@sonorys.at>)
List pgsql-sql
On Thu, Jan 13, 2005 at 18:08:20 +0100, KÖPFERL Robert <robert.koepferl@sonorys.at> 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?
> 
> I already defined a sequence but then?

It is possible to let sequences roll over. One possible solution is to just
try to do inserts with the sequence id and have the application retry when
this fails. If the records being kept are almost all recent ones, this should
work pretty well.


pgsql-sql by date:

Previous
From: KÖPFERL Robert
Date:
Subject: Column with recycled sequence value
Next
From: Andrew Sullivan
Date:
Subject: Re: Column with recycled sequence value