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 <alvhe...@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 raised when trying to drop a constraint of types other than CHECK from a table that has children, such as reported in bug #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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers