From: teknet@poczta.onet.pl
To: pgsql-admin@postgresql.org
Subject: Re: SERIAL type not autoincremented
Date: Fri, 02 Jul 2004 21:40:02 +0200
Message-ID: <20040702194010Z137290-15166+26852@kps2.test.onet.pl> (raw)
In-Reply-To: <200407021131.57987.mike@nachbaur.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: teknet@poczta.onet.pl
Subject: Re: SERIAL type not autoincremented
In-Reply-To: <20040702194010Z137290-15166+26852@kps2.test.onet.pl>
References: <200407021131.57987.mike@nachbaur.com> <20040702194010Z137290-15166+26852@kps2.test.onet.pl>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox