Re: pg primary key bug? - Mailing list pgsql-sql

From pginfo
Subject Re: pg primary key bug?
Date
Msg-id 4214BFE2.50200@t1.unisoftbg.com
Whole thread Raw
In response to Re: pg primary key bug?  (Richard_D_Levine@raytheon.com)
List pgsql-sql
Hi,<br /><br /> No, I do not inherited tables.<br /><br /> The result of this query is:<br /> 01=# SELECT
tableoid::regclass,*<br /> 01-# FROM a_constants_str<br /> 01-# WHERE constname = 'DOCPLAID';<br />     tableoid     |
constname| fid | constvalue <br /> -----------------+-----------+-----+------------<br />  a_constants_str | DOCPLAID 
|  0 | SOF_19738<br />  a_constants_str | DOCPLAID  |   0 | SOF_19738<br /> (2 rows)<br /><br /> regards,<br />
ivan.<br/><br /><br /> Michael Fuhr wrote:<br /><blockquote cite="mid20050217164013.GA26345@winnie.fuhr.org"
type="cite"><prewrap="">On Thu, Feb 17, 2005 at 04:12:38PM +0100, pginfo wrote:
 
 </pre><blockquote type="cite"><pre wrap="">01=# select * from a_constants_str where constname='DOCPLAID' ;
constname | fid | constvalue
-----------+-----+------------
DOCPLAID  |   0 | SOF_19738
DOCPLAID  |   0 | SOF_19738
(2 rows)   </pre></blockquote><pre wrap="">
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),
PRIMARYKEY (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_19738child    | DOCPLAID  |   0 | SOF_19738
(2 rows)
 </pre></blockquote><br />

pgsql-sql by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: pg primary key bug?
Next
From: Tom Lane
Date:
Subject: Re: pg primary key bug?