From: Tom Lane <tgl@sss.pgh.pa.us>
To: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Subject: Re: Conflicting constraint being merged
Date: Thu, 13 Oct 2016 16:35:09 -0400
Message-ID: <30414.1476390909@sss.pgh.pa.us> (raw)
In-Reply-To: <b28ee774-7009-313d-dd55-5bdd81242c41@lab.ntt.co.jp>
References: <b28ee774-7009-313d-dd55-5bdd81242c41@lab.ntt.co.jp>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, Langote_Amit_f8@lab.ntt.co.jp
Subject: Re: Conflicting constraint being merged
In-Reply-To: <30414.1476390909@sss.pgh.pa.us>
References: <b28ee774-7009-313d-dd55-5bdd81242c41@lab.ntt.co.jp> <30414.1476390909@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox