Re: Minor inheritance/check bug: Inconsistent behavior - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: Minor inheritance/check bug: Inconsistent behavior
Date
Msg-id CAA4eK1+7A1FEY3NhhUxTPuY++fYpGcVgR0-tHBj3=vTZZatwog@mail.gmail.com
Whole thread Raw
In response to Re: Minor inheritance/check bug: Inconsistent behavior  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On Fri, Sep 20, 2013 at 7:17 PM, Robert Haas <robertmhaas@gmail.com> wrote:
> On Fri, Sep 20, 2013 at 9:43 AM, Amit Kapila <amit.kapila16@gmail.com> wrote:
>>    Handling for OID is not clear, shall we allow it or not in check constraint?
>>    In my current patch OID will not be allowed in check constraint.
>
> I vote for allowing it.

I had tried to allow for OID case, but setting OID in case of UPDATE
operation is bit tricky.
In ExecUpdate(), we need to set OID in new tuple by getting it from
old tuple, but we only have old tupleid in this function. Using old
tupleid, I can get tuple and then fetch OID from it to set in new
tuple as is done in heap_update(), but it seems bit more work and also
same has to be done in heap_update anyway unless we change signature
of heap_update().
For now, I had updated the patch for below points:
a.  to set tableoid in Copy case
b.  to set tableoid in Alter case
c.  update the docs for Create Table Page. The other places like Alter
Table and Constraints page doesn't have any information related to
what is not allowed in
     check constraints, so I left them as is.

I have not added new tests for Alter/Copy as they will test what
testcase for insert will test. However if you feel we should add test
for Alter/Copy/Update operation, then I will update the patch.

With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

Attachment

pgsql-hackers by date:

Previous
From: Noah Misch
Date:
Subject: Re: pgbench progress report improvements
Next
From: Fabien COELHO
Date:
Subject: Re: pgbench progress report improvements