Re: primary key generation

Поиск
Список
Период
Сортировка
От Wieger Uffink
Тема Re: primary key generation
Дата
Msg-id 1008096314.1964.2.camel@barcelona.usmedia.nep
обсуждение исходный текст
Ответ на primary key generation  ("Ned Matson" <ned@go.com>)
Список pgsql-general
Hi

You need to create a sequence and set the default value of the primary
key on the next value in the sequence.

An easy way to do this is to define the primary key integer field as
type SERIAL ( instead of integer) at time of table creation.
Postgres will automaticly create the sequence it needs, and set the
default value of the key to the proper value.

HTH,
Wieger

On Mon, 2001-12-10 at 22:58, Ned Matson wrote:
> Does postgres have any built-in methods for auto-generating unique integer
> primary keys or is managing this task the responsibility of the user?
>
> Thanks in advance...
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>



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

Предыдущее
От: "Gregory Wood"
Дата:
Сообщение: Re: Help with inner/outer join
Следующее
От: Doug McNaught
Дата:
Сообщение: Re: primary key generation