Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 614AF16DF810 for ; Mon, 2 Jul 2012 07:49:41 -0300 (ADT) Received: from szxga02-in.huawei.com ([119.145.14.65]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SleCI-0007AG-28 for pgsql-bugs@postgresql.org; Mon, 02 Jul 2012 10:49:40 +0000 Received: from 172.24.2.119 (EHLO szxeml213-edg.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.1.9-GA FastPath queued) with ESMTP id ALD06817; Mon, 02 Jul 2012 18:47:07 +0800 (CST) Received: from SZXEML418-HUB.china.huawei.com (10.82.67.157) by szxeml213-edg.china.huawei.com (172.24.2.30) with Microsoft SMTP Server (TLS) id 14.1.323.3; Mon, 2 Jul 2012 18:46:33 +0800 Received: from blrprnc09ns (10.18.96.98) by szxeml418-hub.china.huawei.com (10.82.67.157) with Microsoft SMTP Server id 14.1.323.3; Mon, 2 Jul 2012 18:46:32 +0800 From: Amit Kapila To: , References: In-Reply-To: Subject: Re: BUG #6712: PostgreSQL 9.2 beta2: alter table drop constraint does not work on inherited master table Date: Mon, 2 Jul 2012 16:16:31 +0530 Message-ID: <008101cd583f$f184ab40$d48e01c0$@kapila@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Ac1W01ZTzFLRt+EYRXKkqw/kNA1srABbBmXA Content-Language: en-us X-Originating-IP: [10.18.96.98] X-CFilter-Loop: Reflected X-Pg-Spam-Score: -0.9 (/) X-Archive-Number: 201207/2 X-Sequence-Number: 33478 > From: pgsql-bugs-owner@postgresql.org = [mailto:pgsql-bugs-owner@postgresql.org] On Behalf Of = miroslav.sulc@fordfrog.com > Sent: Saturday, June 30, 2012 4:28 PM > The following bug has been logged on the website: > Bug reference: 6712 > Logged by: Miroslav =C5=A0ulc > Email address: miroslav.sulc@fordfrog.com > PostgreSQL version: Unsupported/Unknown > Operating system: Gentoo Linux > Description: =20 > here is the test case: > test=3D# create table test_constraints (id int, val1 varchar, val2 = int, unique > (val1, val2)); > NOTICE: CREATE TABLE / UNIQUE will create implicit index > "test_constraints_val1_val2_key" for table "test_constraints" > CREATE TABLE > test=3D# create table test_constraints_inh () inherits = (test_constraints); > CREATE TABLE > test=3D# alter table only test_constraints drop constraint > test_constraints_val1_val2_key; > ERROR: constraint "test_constraints_val1_val2_key" of relation > "test_constraints_inh" does not exist > postgresql tries to drop the constraint even from descendant table = though > "only" is specified. In function ATExecDropConstraint(), for the constarint = "test_constraints_val1_val2_key" con->connoinherit is false,=20 due to which it tries to drop the constrint from child table as well.=20 I have checked that from function index_constraint_create() when it = calls function CreateConstraintEntry(), the flag for noinherit passed is = false.=20 I think this is the reason of failure for the same. With Regards, Amit Kapila.