Re: Serials.

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Serials.
Дата
Msg-id Pine.LNX.4.30.0103241526220.2319-100000@peter.localdomain
обсуждение исходный текст
Ответ на Serials.  (Grant <grant@conprojan.com.au>)
Список pgsql-sql
Grant writes:

> (1) Why is a sequence limited to 2147483647, it seems very small?

Because that's what a four-byte signed integer takes.  No one has stepped
forward to implement 8-byte sequence counters, yet.

> (2) If I reset the sequence, then try another insert. It will not insert
> anything until it cycles through all sequences and finds an unused one. It
> will give the following error each time it tries to insert a row with a
> used sequence:
>
> PostgreSQL query failed: ERROR: Cannot insert a duplicate key into unique
> index releases_pkey

Why did you reset the sequence in the first place?  You should probably
set it back to where it was (using setval()).  Sequences simply return
incrementing numbers, they don't fill holes or have any
constraint-avoiding logic.

-- 
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/



В списке pgsql-sql по дате отправления:

Предыдущее
От: Mathijs Brands
Дата:
Сообщение: Re: Serials.
Следующее
От: Andrew Perrin
Дата:
Сообщение: all views in database broken at once