Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T4vBp-0003jG-Mv for pgsql-bugs@postgresql.org; Fri, 24 Aug 2012 14:48:49 +0000 Received: from szxga02-in.huawei.com ([119.145.14.65]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T4vBm-00020g-JK for pgsql-bugs@postgresql.org; Fri, 24 Aug 2012 14:48:49 +0000 Received: from 172.24.2.119 (EHLO szxeml212-edg.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.4-GA FastPath queued) with ESMTP id ANZ17371; Fri, 24 Aug 2012 22:48:38 +0800 (CST) Received: from SZXEML424-HUB.china.huawei.com (10.82.67.163) by szxeml212-edg.china.huawei.com (172.24.2.181) with Microsoft SMTP Server (TLS) id 14.1.323.3; Fri, 24 Aug 2012 22:48:39 +0800 Received: from blrprnc09ns (10.18.96.98) by szxeml424-hub.china.huawei.com (10.82.67.163) with Microsoft SMTP Server id 14.1.323.3; Fri, 24 Aug 2012 22:48:11 +0800 From: Amit Kapila To: "'Tom Lane'" CC: "'Chris Travers'" , References: <10285.1345784596@sss.pgh.pa.us> <000301cd81e6$81f942b0$85ebc810$@kapila@huawei.com> <19794.1345817744@sss.pgh.pa.us> In-Reply-To: <19794.1345817744@sss.pgh.pa.us> Subject: Re: Minor inheritance/check bug: Inconsistent behavior Date: Fri, 24 Aug 2012 20:18:09 +0530 Message-ID: <000701cd8207$7b4e1870$71ea4950$@kapila@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Ac2CAvcNkDerqVRrRQCftwhr0vzwmAAA0q/A Content-Language: en-us X-Originating-IP: [10.18.96.98] X-CFilter-Loop: Reflected X-Pg-Spam-Score: -1.1 (-) X-Archive-Number: 201208/189 X-Sequence-Number: 33913 From: Tom Lane [mailto:tgl@sss.pgh.pa.us] Sent: Friday, August 24, 2012 7:46 PM Amit Kapila writes: > From: pgsql-bugs-owner@postgresql.org > [mailto:pgsql-bugs-owner@postgresql.org] On Behalf Of Tom Lane >>> None of the system columns are set at the time check constraints are >>> checked. >> Is there any problem if set tableOID before calling ExecConstarints()? > Well, possibly we could kluge things to make that particular case work, > but if someone expects that to be valid then why not oid, ctid, xmin, > etc? Initially, I thought of saying like that but the same is done in heap_prepare_insert() So doing it 2 times doesn't make sense and if we move them out then all places from where heap_insert gets called, we have to do it like that. However why I have asked to set tableOID, as for it, already functions CopyFrom and AtRewriteTable does it(set tableOid before Constraints check). > And more to the point, what's the value of examining tableoid in > a check constraint? The constraint is attached to a particular table, > so the tableoid would be a constant for it anyway. Here what you are suggesting if I understood correctly is while defining such constraints make sure its not allowed, because once defined, during execution we might not be able to identify. Please correct me if I have misunderstood? With Regards, Amit Kapila.