Re: PostgreSQL: SQLSetPos fails with SetPos update return error. - Mailing list pgsql-odbc

From Tsunakawa, Takayuki
Subject Re: PostgreSQL: SQLSetPos fails with SetPos update return error.
Date
Msg-id 0A3221C70F24FB45833433255569204D1F57A6CF@G01JPEXMBYT05
Whole thread Raw
In response to Re: PostgreSQL: SQLSetPos fails with SetPos update return error.  ("Venkatesan, Sekhar" <sekhar.venkatesan@emc.com>)
Responses Re: PostgreSQL: SQLSetPos fails with SetPos update return error.  ("Venkatesan, Sekhar" <sekhar.venkatesan@emc.com>)
List pgsql-odbc

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

 

 

 

 

pgsql-odbc by date:

Previous
From: "Venkatesan, Sekhar"
Date:
Subject: Re: PostgreSQL: SQLSetPos fails with SetPos update return error.
Next
From: "Tsunakawa, Takayuki"
Date:
Subject: [patch] fix buffer overrun in logging, and code cleanup