Re: Minor inheritance/check bug: Inconsistent behavior

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Minor inheritance/check bug: Inconsistent behavior
Date: 2013-09-21 07:35:45
Message-ID: CAA4eK1+7A1FEY3NhhUxTPuY++fYpGcVgR0-tHBj3=vTZZatwog@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Sep 20, 2013 at 7:17 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Fri, Sep 20, 2013 at 9:43 AM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)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 Content-Type Size
sys_col_constr_v4.patch application/octet-stream 6.3 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabien COELHO 2013-09-21 08:55:54 Re: pgbench progress report improvements
Previous Message Noah Misch 2013-09-21 04:43:53 Re: pgbench progress report improvements