Re: Column with recycled sequence value

Поиск
Список
Период
Сортировка
От Andrew Sullivan
Тема Re: Column with recycled sequence value
Дата
Msg-id 20050113194900.GB31858@phlogiston.dyndns.org
обсуждение исходный текст
Ответ на Column with recycled sequence value  (KÖPFERL Robert <robert.koepferl@sonorys.at>)
Ответы Re: Column with recycled sequence value  (PFC <lists@boutiquenumerique.com>)
Re: Column with recycled sequence value  (Greg Stark <gsstark@mit.edu>)
Список 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 по дате отправления:

Предыдущее
От: Bruno Wolff III
Дата:
Сообщение: Re: Column with recycled sequence value
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: Column with recycled sequence value