Re: Auto incrementing primary keys

Поиск
Список
Период
Сортировка
От Steve Atkins
Тема Re: Auto incrementing primary keys
Дата
Msg-id 6A049D96-D7B8-4892-AC0C-06F378F350A1@blighty.com
обсуждение исходный текст
Ответ на Re: Auto incrementing primary keys  (Raymond O'Donnell <rod@iol.ie>)
Ответы Re: Auto incrementing primary keys
Список pgsql-general
On Feb 18, 2008, at 9:56 AM, Raymond O'Donnell wrote:

> On 18/02/2008 17:46, Raymond O'Donnell wrote:
>
>> Well, that depends on your usage, so only you can answer that.
>> According to the docs, "serial" creates an integer column,  which
>> will give you 2147483647 values - how quickly will you use that lot
>> up? If you think you will run out, by all means use bigserial.
>
> Actually, that isn't quite right - just looked at the docs for
> CREATE SEQUENCE, and the default maximum value is 2^63-1.

That's the maximum value for the sequence itself, but a "serial" is
just an integer, so the 2^31-1 limit before wraparound still applies.

Cheers,
   Steve


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

Предыдущее
От: Raymond O'Donnell
Дата:
Сообщение: Re: Auto incrementing primary keys
Следующее
От: Enrico Sirola
Дата:
Сообщение: Re: questions about very large table and partitioning