On Fri, Sep 20, 2013 at 7:17 PM, Robert Haas <robertmh...@gmail.com> wrote: > On Fri, Sep 20, 2013 at 9:43 AM, Amit Kapila <amit.kapil...@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
sys_col_constr_v4.patch
Description: Binary data
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers