X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 908E88B9B1B; Thu, 17 Feb 2005 16:40:37 +0000 (GMT) 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 66514-04; Thu, 17 Feb 2005 16:40:23 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id 77D9F8B9D07; Thu, 17 Feb 2005 16:40:22 +0000 (GMT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.1/8.13.1) with ESMTP id j1HGeGd5031058 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 17 Feb 2005 09:40:18 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.1/8.13.1) with ESMTP id j1HGeFQ0026385; Thu, 17 Feb 2005 09:40:15 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.1/8.13.1/Submit) id j1HGeDve026384; Thu, 17 Feb 2005 09:40:13 -0700 (MST) (envelope-from mfuhr) Date: Thu, 17 Feb 2005 09:40:13 -0700 From: Michael Fuhr To: pginfo Cc: Richard_D_Levine@raytheon.com, Michael Glaesemann , pgsql-sql@postgresql.org, pgsql-sql-owner@postgresql.org Subject: Re: pg primary key bug? Message-ID: <20050217164013.GA26345@winnie.fuhr.org> References: <4214B466.20908@t1.unisoftbg.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4214B466.20908@t1.unisoftbg.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.106 tagged_above=0 required=5 tests=AWL, UPPERCASE_25_50 X-Spam-Level: X-Archive-Number: 200502/191 X-Sequence-Number: 20302 On Thu, Feb 17, 2005 at 04:12:38PM +0100, pginfo wrote: > 01=# select * from a_constants_str where constname='DOCPLAID' ; > constname | fid | constvalue > -----------+-----+------------ > DOCPLAID | 0 | SOF_19738 > DOCPLAID | 0 | SOF_19738 > (2 rows) Do you have any inherited tables? What's the result of the following query? SELECT tableoid::regclass, * FROM a_constants_str WHERE constname = 'DOCPLAID'; Inherited tables are documented to have deficiencies regarding constraints. Observe: CREATE TABLE parent ( constname varchar(30) NOT NULL, fid integer NOT NULL, constvalue varchar(30), PRIMARY KEY (constname, fid) ); CREATE TABLE child () INHERITS (parent); INSERT INTO parent VALUES ('DOCPLAID', 0, 'SOF_19738'); INSERT INTO parent VALUES ('DOCPLAID', 0, 'SOF_19738'); ERROR: duplicate key violates unique constraint "parent_pkey" INSERT INTO child VALUES ('DOCPLAID', 0, 'SOF_19738'); SELECT tableoid::regclass, * FROM parent; tableoid | constname | fid | constvalue ----------+-----------+-----+------------ parent | DOCPLAID | 0 | SOF_19738 child | DOCPLAID | 0 | SOF_19738 (2 rows) -- Michael Fuhr http://www.fuhr.org/~mfuhr/