Re: Conflicting constraint being merged

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Conflicting constraint being merged
Date: 2016-10-13 20:35:09
Message-ID: 30414.1476390909@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Nasby 2016-10-13 20:36:17 Re: How to inspect tuples during execution of a plan?
Previous Message Alvaro Herrera 2016-10-13 20:26:42 Re: Pluggable storage