X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 76DE6D1B198 for ; Fri, 2 Jul 2004 15:14:32 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 93713-01 for ; Fri, 2 Jul 2004 18:14:30 +0000 (GMT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id 9BA23D1B1B0 for ; Fri, 2 Jul 2004 15:14:27 -0300 (ADT) Received: (qmail 32739 invoked by uid 500); 2 Jul 2004 18:21:09 -0000 Date: Fri, 2 Jul 2004 13:21:09 -0500 From: Bruno Wolff III To: teknet@poczta.onet.pl Cc: pgsql-admin@postgresql.org Subject: Re: SERIAL type not autoincremented Message-ID: <20040702182109.GB31625@wolff.to> Mail-Followup-To: teknet@poczta.onet.pl, pgsql-admin@postgresql.org References: <20040702172227Z4873738-14310+28550@kps5.test.onet.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040702172227Z4873738-14310+28550@kps5.test.onet.pl> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200407/45 X-Sequence-Number: 14113 On Fri, Jul 02, 2004 at 19:22:17 +0200, teknet@poczta.onet.pl wrote: > 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 ? You probably manually changed the value of the sequence student_id_seq.