Re: Conflicting constraint being merged - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Conflicting constraint being merged
Date
Msg-id 30414.1476390909@sss.pgh.pa.us
Whole thread Raw
In response to Conflicting constraint being merged  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
List pgsql-hackers
Amit Langote <Langote_Amit_f8@lab.ntt.co.jp> writes:
> Currently, if child table has a non-inherited constraint and a constraint
> with the same name is added to the parent, it will fail with an error as
> illustrated below:
> ...
> If we had allowed it to be merged, any children of child itself won't
> inherit that constraint (because on child it's marked NO INHERIT), which
> would not be good.

Right.  Merging must happen only for inheritable constraints.

> However, it is still possible for a child to override/hide the parent's
> constraint as follows:

Hmm, I thought I'd checked for this when I was fooling with constraint
merging a few days ago.  I must have checked one of the other cases and
missed this path.  Thanks for catching it!
        regards, tom lane



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Pluggable storage
Next
From: Jim Nasby
Date:
Subject: Re: How to inspect tuples during execution of a plan?