pgsql: connoinherit may be true only for CHECK constraints

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: connoinherit may be true only for CHECK constraints
Date: 2012-07-20 18:10:53
Message-ID: E1SsHfB-0000Qf-2f@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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
------
REL9_2_STABLE

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

Modified Files
--------------
src/backend/catalog/index.c | 2 +-
src/backend/commands/tablecmds.c | 12 +++-
src/backend/commands/trigger.c | 2 +-
src/test/regress/expected/inherit.out | 120 +++++++++++++++++++++++++++++++++
src/test/regress/sql/inherit.sql | 36 ++++++++++
5 files changed, 169 insertions(+), 3 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2012-07-20 19:35:52 pgsql: pg_dump: Simplify mkdir() error checking
Previous Message Tom Lane 2012-07-20 17:11:24 pgsql: Fix whole-row Var evaluation to cope with resjunk columns (again