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

Поиск
Список
Период
Сортировка
От Richard Broersma Jr
Тема Re: IS it a good practice to use SERIAL as Primary Key?
Дата
Msg-id 376682.53088.qm@web31801.mail.mud.yahoo.com
обсуждение исходный текст
Ответ на IS it a good practice to use SERIAL as Primary Key?  ("carter ck" <carterck32@hotmail.com>)
Ответы Re: IS it a good practice to use SERIAL as Primary Key?  (Jorge Godoy <jgodoy@gmail.com>)
Список pgsql-general
> I am wonderring if it is a good practice to use SERIAL index as primary key,
> as it is only available up to 9999999?

That isn't true.  It is much larger that that. If yor need more than that there is always
bigserial.

serial    = int4
bigserial = int8

""
The type names serial and serial4 are equivalent: both create integer columns. The type names
bigserial and serial8 work just the same way, except that they create a bigint column. bigserial
should be used if you anticipate the use of more than 231 identifiers over the lifetime of the
table.
""
http://www.postgresql.org/docs/8.2/interactive/datatype-numeric.html#DATATYPE-SERIAL

> 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.

Here is a similar discussion that you may be enterested in:
http://archives.postgresql.org/pgsql-general/2006-10/msg00024.php

Regards,

Richard Broersma Jr.

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: IS it a good practice to use SERIAL as Primary Key?
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Possible problem with PQescapeStringConn and