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

Поиск
Список
Период
Сортировка
От Steve Atkins
Тема Re: IS it a good practice to use SERIAL as Primary Key?
Дата
Msg-id 0B19264A-C035-4283-8482-B1AB92EE6A3D@blighty.com
обсуждение исходный текст
Ответ на IS it a good practice to use SERIAL as Primary Key?  ("carter ck" <carterck32@hotmail.com>)
Список 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 по дате отправления:

Предыдущее
От: "zenith siea"
Дата:
Сообщение: 2 problems of my postgresql
Следующее
От: Tom Lane
Дата:
Сообщение: Re: 8.2Beta3 - create view testview (a,b,c) values (1,2,3),(4,5,6),...