Re: SERIAL or INT8 / Unique BLOB's

Поиск
Список
Период
Сортировка
От Dave Trombley
Тема Re: SERIAL or INT8 / Unique BLOB's
Дата
Msg-id 3C33B412.9030509@bumba.net
обсуждение исходный текст
Ответ на SERIAL or INT8 / Unique BLOB's  ("Richard Teviotdale" <richard@satcomresources.com>)
Ответы Re: SERIAL or INT8 / Unique BLOB's  ("Jeffrey W. Baker" <jwbaker@acm.org>)
Список pgsql-general
Richard Teviotdale wrote:

> Using SERIAL or INT8
>
>
>
> I have been using SERIAL a great deal when creating table primary keys.
>
> The type of integer that this creates is an INT4, but I noticed that
> there is a larger INT8 available.
>
>
>
> Would it be advisable to create a sequence manually and use the INT8
> if the table size might be expected to grow beyond the 2 billion limit
> imposed by a INT4 (INTEGER) field type?
>
>
>
       Currently, I don't think sequences can return values larger than
the max int4. You could of course emulate a sequence, but if you don't
have a large number of rows at any given time you may want to take
advantage of the fact that sequences can cycle around, optionally, since
they do cache values for performance gain.


(http://www2.us.postgresql.org/users-lounge/docs/7.1/reference/sql-createsequence.html
)


       Also, FYI, 7.2 looks-like-it-will/does have a
'bigserial'/'serial8' type.

    -dj trombley
     <dtrom@bumba.net>




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

Предыдущее
От: Nate Haggard
Дата:
Сообщение: copy from ???
Следующее
От: "Jeffrey W. Baker"
Дата:
Сообщение: Re: SERIAL or INT8 / Unique BLOB's