From: Venkatesan, Sekhar [mailto:sekhar.venkatesan@emc.com]
When partition is enabled in my application and I change the partitioning key in the table to save the new data into another partition, I get error like this:
ERROR: new row for relation "testpart_s" violates check constraint " p1_testpart12_s"
I enabled constraint_exclusion in postgresql.conf.
I followed the document you shared to enable row movement across partitions by writing triggers on partition tables. It works up to a point but not confident it will work for all use-cases.
Did this error begin to happen with the unreleased driver, or already happen with the officially released driver?
SQLSetPos(SQL_UPDATE) issues an UPDATE statement. Could you identify the statement causing the error by logging the statements, i.e. adding log_statement = ‘all’ in postgresql.conf? Does the statement seem to be wroing when you consider the check constraint name, i.e. is the target table correct?
Are you sure your trigger specifies the appropriate table for the new key value?
Regards
Takayuki Tsunakawa