Re: IS it a good practice to use SERIAL as Primary Key?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "carter ck" <carterck32(at)hotmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: IS it a good practice to use SERIAL as Primary Key?
Date: 2006-11-23 02:33:10
Message-ID: 7316.1164249190@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"carter ck" <carterck32(at)hotmail(dot)com> writes:
> I am wonderring if it is a good practice to use SERIAL index as primary key,
> as it is only available up to 9999999?

Where in the world did you get that idea?

SERIAL goes up to 2^31 (2 billion); if you need more use BIGSERIAL.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Richard Broersma Jr 2006-11-23 02:36:58 Re: IS it a good practice to use SERIAL as Primary Key?
Previous Message Tom Lane 2006-11-23 02:31:42 Re: 8.2Beta3 - create view testview (a, b, c) values (1, 2, 3), (4, 5, 6), ...