Re: SERIAL or INT8 / Unique BLOB's - Mailing list pgsql-general

From Dave Trombley
Subject Re: SERIAL or INT8 / Unique BLOB's
Date
Msg-id 3C33B412.9030509@bumba.net
Whole thread Raw
In response to SERIAL or INT8 / Unique BLOB's  ("Richard Teviotdale" <richard@satcomresources.com>)
Responses Re: SERIAL or INT8 / Unique BLOB's  ("Jeffrey W. Baker" <jwbaker@acm.org>)
List 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 by date:

Previous
From: Nate Haggard
Date:
Subject: copy from ???
Next
From: "Jeffrey W. Baker"
Date:
Subject: Re: SERIAL or INT8 / Unique BLOB's