Re: Column with recycled sequence value

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: Column with recycled sequence value
Дата
Msg-id 20050113201624.GA3418@wolff.to
обсуждение исходный текст
Ответ на Column with recycled sequence value  (KÖPFERL Robert <robert.koepferl@sonorys.at>)
Список 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 по дате отправления:

Предыдущее
От: KÖPFERL Robert
Дата:
Сообщение: Column with recycled sequence value
Следующее
От: Andrew Sullivan
Дата:
Сообщение: Re: Column with recycled sequence value