Re: SERIAL type not autoincremented

Поиск
Список
Период
Сортировка
От teknet@poczta.onet.pl
Тема Re: SERIAL type not autoincremented
Дата
Msg-id 20040702194010Z137290-15166+26852@kps2.test.onet.pl
обсуждение исходный текст
Ответ на Re: SERIAL type not autoincremented  (Michael A Nachbaur <mike@nachbaur.com>)
Ответы Re: SERIAL type not autoincremented  (Radu-Adrian Popescu <radu.popescu@aldratech.com>)
Re: SERIAL type not autoincremented  (Bruno Wolff III <bruno@wolff.to>)
Re: SERIAL type not autoincremented  ("Larry Rosenman" <ler@lerctr.org>)
Список pgsql-admin

i found the problem:

 

sys=> create table test2(
sys(> id serial,
sys(> name varchar(10),
sys(> primary key(id)
sys(> );
NOTICE:  CREATE TABLE will create implicit sequence "test2_id_seq" for "serial" column "test2.id"
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "test2_pkey" for table "test2"
CREATE TABLE
sys=> insert into test2 values(1,'myname');
INSERT 18765 1
sys=> insert into test2 (name) values('myname2');
ERROR:  duplicate key violates unique constraint "test2_pkey"
sys=>

Why is it so ?

 

Thanx

Michal

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

Предыдущее
От: "Bender, Cheryl"
Дата:
Сообщение: Re: Dumping partial database content
Следующее
От: Christopher Browne
Дата:
Сообщение: Re: Dumping partial database content