Re: patch for check constraints using multiple inheritance - Mailing list pgsql-hackers

From Alex Hunsaker
Subject Re: patch for check constraints using multiple inheritance
Date
Msg-id AANLkTikkDTj9sZh4o10QWikvLd4+om-Tz6-3+vSHyniJ@mail.gmail.com
Whole thread Raw
In response to Re: patch for check constraints using multiple inheritance  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On Fri, Jul 30, 2010 at 10:22, Robert Haas <robertmhaas@gmail.com> wrote:

> OK, it looks like level_2_parent is actually irrelevant to this issue.
>  So here's a slightly simplified test case:
>
> DROP SCHEMA IF EXISTS test_inheritance CASCADE;
> CREATE SCHEMA test_inheritance;
> SET search_path TO test_inheritance;
>
> CREATE TABLE top (i int);
> CREATE TABLE mid1 () INHERITS (top);
> CREATE TABLE mid2 () INHERITS (top);
> CREATE TABLE bottom () INHERITS (mid1, mid2);
> CREATE TABLE basement () INHERITS (bottom);
>
> ALTER TABLE top ADD CONSTRAINT a_check_constraint CHECK (i = 0);

The other problem with the current code is it creates a dump that is
not consistent with \d.  The dump gets it "right" in the sense that
basement does not have the constraint.  We could debate what
coninhcount should be, but clearly there is a bug here. [ FYI with
your patch the dump is, of course, consistent again (no
a_check_constraint) ]


pgsql-hackers by date:

Previous
From: Jan Urbański
Date:
Subject: Re: gincostestimate
Next
From: Robert Haas
Date:
Subject: Re: reducing NUMERIC size for 9.1