]> granicus.if.org Git - postgresql/commit
connoinherit may be true only for CHECK constraints
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Fri, 20 Jul 2012 16:33:34 +0000 (12:33 -0400)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Fri, 20 Jul 2012 18:07:09 +0000 (14:07 -0400)
commitd721f208afeac72a943dc88d072ff3df05f53fef
tree7e6ef8afd6668d6c3407093c691b9df0c0763306
parentd7991a13d86e2b94b0ca3d087fdad8a840ebf025
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.
src/backend/catalog/index.c
src/backend/commands/tablecmds.c
src/backend/commands/trigger.c
src/test/regress/expected/inherit.out
src/test/regress/sql/inherit.sql