Re: How to auto create a unique key for each newly added record?

Поиск
Список
Период
Сортировка
От Zak McGregor
Тема Re: How to auto create a unique key for each newly added record?
Дата
Msg-id 200103270336.FAA03305@zak.home.dom
обсуждение исходный текст
Ответ на How to auto create a unique key for each newly added record?  ("Jeff" <jklcom@mindspring.com>)
Список pgsql-general
On Mon, 26 Mar 2001 21:20:13 -0500
"Jeff" <jklcom@mindspring.com> wrote:

> Hi,
>
> How to if it is possible to let postgresql to auto assign unique key to each
> new record that is added to the database?
>
Just set up the table with the field you are wanting to have as a unique id as type "serial".

eg:

create table auto_id (id serial, description varchar(32));

Cheers

Zak

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

Предыдущее
От: Stephen Davies
Дата:
Сообщение: records zapped to null
Следующее
От: Zak McGregor
Дата:
Сообщение: Re: How to copy a table?