X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.192]) by svr1.postgresql.org (Postfix) with ESMTP id 65AD5CC382 for ; Tue, 15 Jul 2003 15:25:40 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr4.postgresql.org [64.117.224.192]) (amavisd-new, port 10024) with ESMTP id 05466-04 for ; Tue, 15 Jul 2003 15:26:08 +0000 (GMT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 09482CC3D3 for ; Tue, 15 Jul 2003 12:25:38 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h6FFPxQ3022801; Tue, 15 Jul 2003 11:25:59 -0400 (EDT) To: Scott Cain Cc: pgsql-sql@postgresql.org Subject: Re: Cannot insert dup id in pk In-reply-to: <1058274025.1451.6.camel@localhost.localdomain> References: <1058274025.1451.6.camel@localhost.localdomain> Comments: In-reply-to Scott Cain message dated "15 Jul 2003 09:00:25 -0400" Date: Tue, 15 Jul 2003 11:25:59 -0400 Message-ID: <22800.1058282759@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/182 X-Sequence-Number: 14296 Scott Cain writes: > Note that I do not try to insert anything into fid, the primary key on > this table. Why does Postgres think I am? But you *are* trying to insert something into fid, namely the default value: default nextval('public.fdata _fid_seq'::text) My guess is that you have been inconsistent about whether you used the sequence or explicit assignment to fid, and now you have some rows in the table that have fid values higher than the current sequence value. I'd suggest adjusting the sequence, along the lines of SELECT setval('public.fdata _fid_seq', max(fid)+1) FROM fdata; regards, tom lane