pgsql: connoinherit may be true only for CHECK constraints - Mailing list pgsql-committers

From Alvaro Herrera
Subject pgsql: connoinherit may be true only for CHECK constraints
Date
Msg-id E1SsHfB-0000Qd-1i@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/f5bcd398addcbeb785f0513cf28cba5d1ecd2c8a

Modified Files
--------------
src/backend/catalog/index.c           |    2 +-
src/backend/commands/tablecmds.c      |    2 +-
src/backend/commands/trigger.c        |    2 +-
src/include/catalog/catversion.h      |    2 +-
src/test/regress/expected/inherit.out |  117 +++++++++++++++++++++++++++++++++
src/test/regress/sql/inherit.sql      |   36 ++++++++++
6 files changed, 157 insertions(+), 4 deletions(-)


pgsql-committers by date:

Previous
From: Alvaro Herrera
Date:
Subject: pgsql: connoinherit may be true only for CHECK constraints
Next
From: Peter Eisentraut
Date:
Subject: pgsql: pg_dump: Simplify mkdir() error checking