Re: Primary Key Constraint on inheritance table not getting route to child tables - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Primary Key Constraint on inheritance table not getting route to child tables
Date
Msg-id 1345472788-sup-2672@alvh.no-ip.org
Whole thread Raw
In response to Primary Key Constraint on inheritance table not getting route to child tables  (Rushabh Lathia <rushabh.lathia@gmail.com>)
List pgsql-hackers
Excerpts from Rushabh Lathia's message of lun ago 20 02:50:52 -0400 2012:
> Hi,
>
> ALTER TABLE ADD Constraints PRIMARY KEY on inheritance table not getting
> route to child table.
>
> But when we do ALTER TABLE DROP Constraint on the same, it complains about
> constraint does not
> exists on child table.

This is a known 9.2 bug, fixed a month in this commit:

Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
Branch: master [f5bcd398a] 2012-07-20 14:08:07 -0400
Branch: REL9_2_STABLE [d721f208a] 2012-07-20 14:07:09 -0400
   connoinherit may be true only for CHECK constraints      The code was setting it true for other constraints, which
is  bogus.  Doing so caused bogus catalog entries for such constraints, and   in particular caused an error to be
raisedwhen trying to drop a   constraint of types other than CHECK from a table that has children,   such as reported
inbug #6712.      In 9.2, additionally ignore connoinherit=true for other constraint   types, to avoid having to force
initdb;existing databases might already   contain bogus catalog entries.      Includes a catversion bump (in HEAD
only).     Bug report from Miroslav Šulc   Analysis from Amit Kapila and Noah Misch; Amit also contributed the patch. 


I cannot reproduce it in 9.2 HEAD or master HEAD.  I assume you were
testing with something older than the above commit; the 9.1 branch does
not contain the bug.

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Avoiding repeated snapshot computation
Next
From: Robert Haas
Date:
Subject: Re: The pgrminclude problem