Re: Impact of loss of unique SERIAL?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Impact of loss of unique SERIAL?
Дата
Msg-id 22080.1051713312@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Impact of loss of unique SERIAL?  ("Justin Long" <justinlong@strategicnetwork.org>)
Список pgsql-admin
"Justin Long" <justinlong@strategicnetwork.org> writes:
> We have been running Postgres 7.2.x for our website, and are considering the
> upgrade to 7.3.x. However, in reading through the changelogs I notice that
> SERIAL values are no longer unique.

You misread it.  SERIAL does not automatically create a unique index on
the column anymore, but the sequence mechanism hasn't changed.  If you
want a unique index, you just say "SERIAL UNIQUE" instead of "SERIAL".
The index is mainly useful as a backstop to guarantee you don't mess up
(eg, by manually inserting values into the column rather than letting
them be taken from the sequence).  Some might see it as unnecessary
overhead.

            regards, tom lane


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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: Impact of loss of unique SERIAL?
Следующее
От: Jodi Kanter
Дата:
Сообщение: LC_CTYPE