Re: IS it a good practice to use SERIAL as Primary Key? - Mailing list pgsql-general

From Steve Atkins
Subject Re: IS it a good practice to use SERIAL as Primary Key?
Date
Msg-id 0B19264A-C035-4283-8482-B1AB92EE6A3D@blighty.com
Whole thread Raw
In response to IS it a good practice to use SERIAL as Primary Key?  ("carter ck" <carterck32@hotmail.com>)
List pgsql-general
On Nov 22, 2006, at 6:23 PM, carter ck wrote:

> Hi all,
>
> 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 did you get that idea? A serial should be good up to at least
2,000,000,000 or so, and if that's not enough there's always bigserial.

>
> Currently i am dealing with storing LDAP users into Postgres and i
> am looking for a better way to make use of the DN as primary key
> instead of SERIAL index.
>
> Any advice or suggestion is appreciated.

If you want a synthetic primary key then a serial field is the
easiest way to create one.

Cheers,
   Steve

pgsql-general by date:

Previous
From: "zenith siea"
Date:
Subject: 2 problems of my postgresql
Next
From: Tom Lane
Date:
Subject: Re: 8.2Beta3 - create view testview (a,b,c) values (1,2,3),(4,5,6),...