Re: SERIAL or INT8 / Unique BLOB's

From: Dave Trombley <dtrom(at)bumba(dot)net>
To: Richard Teviotdale <richard(at)satcomresources(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: SERIAL or INT8 / Unique BLOB's
Date: 2002-01-03 01:29:54
Message-ID: 3C33B412.9030509@bumba.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)bumba(dot)net>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Davis 2002-01-03 01:37:30 Re: PostgreSQL GUI
Previous Message Jeff Davis 2002-01-03 01:21:41 Re: PostgreSQL GUI