Re: Column with recycled sequence value

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: KÖPFERL Robert <robert(dot)koepferl(at)sonorys(dot)at>
Cc: "'pgsql-sql(at)postgresql(dot)org'" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Column with recycled sequence value
Date: 2005-01-13 20:16:24
Message-ID: 20050113201624.GA3418@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Thu, Jan 13, 2005 at 18:08:20 +0100,
KÖPFERL Robert <robert(dot)koepferl(at)sonorys(dot)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.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Scott Marlowe 2005-01-13 20:48:47 Re: Column with recycled sequence value
Previous Message Andrew Sullivan 2005-01-13 19:49:00 Re: Column with recycled sequence value