Question on Inheritance and Primary Keys. - Mailing list pgsql-sql

From Dutt Kalapatapu
Subject Question on Inheritance and Primary Keys.
Date
Msg-id 3.0.6.32.19991011122638.009aa3e0@pop.eudoramail.com
Whole thread Raw
Responses Re: [SQL] Question on Inheritance and Primary Keys.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
I have two Tables:

TableA(
parameterone int,
parametertwo int,
PRIMARYKEY(parameterone),
UNIQUE(parameterone)
);

TableB(
parameterthree int
)INHERITS(TableA);


I expect from this that when we insert some thing in TableB then
parameterone should be unique, but the database is not enforcing the rule
and it takes duplicate values.  But when I insert two duplicate keys in
TableA then it complains.  This means that Inheritance removes the
primarykey etc from the inherited table??? I couldn't think why this object
oriented behaviour doesn't work here.


Can some one explain this behaviour.

Thanks
Dutt

--Dutt Kalapatapu   ________________________  |ipVerse Inc.,           |  |1901 Landings Drive     |  |Mountain View,
CA-94043|  |Telefono: 650 919 0647  |  |________________________|
 


pgsql-sql by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [SQL] DELETE/DROP and inheritance
Next
From: "Saltsgaver, Scott"
Date:
Subject: Reporting errors when a rule fails.