Re: auto increment primary key

Поиск
Список
Период
Сортировка
От Frank Joerdens
Тема Re: auto increment primary key
Дата
Msg-id 20020405123039.A3241@superfly.archi-me-des.de
обсуждение исходный текст
Ответ на auto increment primary key  (impala <bhnnc@yahoo.co.uk>)
Список pgsql-general
On Fri, Apr 05, 2002 at 02:21:19AM -0800, impala wrote:
> I created a table, want the integer/varchar primary
> key column to be incremented automatically when
> inserted a new row. How do I define the table to do
> that? I tried AUTO_INCREMENT and INCREMENT but
> postgres accept none of them.

create table foo (
bar    serial primary key,
 . . .

This implies the creation of a special table called a sequence which
does the auto-incrementing.

Regards, Frank

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

Предыдущее
От: impala
Дата:
Сообщение: auto increment primary key
Следующее
От: "Marin Dimitrov"
Дата:
Сообщение: Re: auto increment primary key