SERIAL type not autoincremented

From: teknet(at)poczta(dot)onet(dot)pl
To: pgsql-admin(at)postgresql(dot)org
Subject: SERIAL type not autoincremented
Date: 2004-07-02 17:22:17
Message-ID: 20040702172227Z4873738-14310+28550@kps5.test.onet.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hello
i have:
create table student(
id SERIAL NOT NULL,
name VARCHAR(35) NOT NULL,
primary key (id)
);

and when i try to insert like this:
insert into student (name) values('me');
i receive error:
ERROR: duplicate key violates unique constraint "student_pkey"

Why ? Do i understeand correctly that SERIAL == AUTO_INCREMENT ?
As far as i remember i used such type in the past and had no problem.
What do i miss ?

Thanx
Michal

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Jim Seymour 2004-07-02 18:09:34 Re: SERIAL type not autoincremented
Previous Message teknet 2004-07-02 17:18:21 Re: 7.4.3 initdb: could not create semaphores