pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruno Wolff III <bruno@wolff.to>
To: KÖPFERL Robert <robert.koepferl@sonorys.at>
Cc: 'pgsql-sql@postgresql.org' <pgsql-sql@postgresql.org>
Subject: Re: Column with recycled sequence value
Date: Thu, 13 Jan 2005 14:16:24 -0600
Message-ID: <20050113201624.GA3418@wolff.to> (raw)
In-Reply-To: <ED4E30DD9C43D5118DFB00508BBBA76EB1654B@neptun.sonorys.at>
References: <ED4E30DD9C43D5118DFB00508BBBA76EB1654B@neptun.sonorys.at>

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.



view thread (13+ messages)  latest in thread

Message-ID: <20050113201624.GA3418@wolff.to>
Permalink:  ../20050113201624.GA3418@wolff.to/
Also on:    postgresql.org/message-id/20050113201624.GA3418@wolff.to

 · 

reply

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: bruno@wolff.to, robert.koepferl@sonorys.at
  Subject: Re: Column with recycled sequence value
  In-Reply-To: <20050113201624.GA3418@wolff.to>

* 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