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

From: Steve Atkins <steve(at)blighty(dot)com>
To: PgSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: IS it a good practice to use SERIAL as Primary Key?
Date: 2006-11-23 02:28:52
Message-ID: 0B19264A-C035-4283-8482-B1AB92EE6A3D@blighty.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next 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), ...
Previous Message zenith siea 2006-11-23 02:24:08 2 problems of my postgresql