Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bumk8-0004BY-GX for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Oct 2016 20:36:44 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bumk8-0001Jy-32 for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Oct 2016 20:36:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bumij-0007yx-N6 for pgsql-hackers@postgresql.org; Thu, 13 Oct 2016 20:35:17 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bumig-0004qy-I2 for pgsql-hackers@postgresql.org; Thu, 13 Oct 2016 20:35:16 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u9DKZ9Eo030415; Thu, 13 Oct 2016 16:35:10 -0400 From: Tom Lane To: Amit Langote cc: Pg Hackers Subject: Re: Conflicting constraint being merged In-reply-to: References: Comments: In-reply-to Amit Langote message dated "Wed, 12 Oct 2016 16:55:46 +0900" Date: Thu, 13 Oct 2016 16:35:09 -0400 Message-ID: <30414.1476390909@sss.pgh.pa.us> X-Pg-Spam-Score: -2.3 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Amit Langote 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