Re: Primary Key

Поиск
Список
Период
Сортировка
От Nabil Sayegh
Тема Re: Primary Key
Дата
Msg-id 40CEC779.5070703@e-trolley.de
обсуждение исходный текст
Ответ на Primary Key  (Eduardo V. Rodríguez <evazquez@insys-corp.com.mx>)
Список pgsql-novice
Eduardo V. Rodríguez wrote:

> id - month . day - time
> 1    Jan          22   16:15
> 2    Jan       22   16:16
> 3    Jan       22   16:17
> 4    Jan       22   16:18
>
> But I pretend that automatically when I made an INSERT INTO table (month,
> day, time) values (A,B,C) the primary key update his value increasing by one

CREATE TABLE foo (id_foo SERIAL PRIMARY KEY, month ...);

SERIAL is of type int creates automatically a sequence that increments each time you don't specify
the id in an INSERT.

HTH
--
  e-Trolley Sayegh & John, Nabil Sayegh
  Tel.: 0700 etrolley /// 0700 38765539
  Fax.: +49 69 8299381-8
  PGP : http://www.e-trolley.de

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

Предыдущее
От: Mike G
Дата:
Сообщение: Re: Primary Key
Следующее
От: Michael Guerin
Дата:
Сообщение: page x is unitialized