Re: PostgreSQL: SQLSetPos fails with SetPos update return error.

From: "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>
To: "Venkatesan, Sekhar" <sekhar(dot)venkatesan(at)emc(dot)com>
Cc: "Inoue, Hiroshi" <h-inoue(at)dream(dot)email(dot)ne(dot)jp>, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, "pgsql-odbc(at)postgresql(dot)org" <pgsql-odbc(at)postgresql(dot)org>
Subject: Re: PostgreSQL: SQLSetPos fails with SetPos update return error.
Date: 2016-05-26 02:10:11
Message-ID: 0A3221C70F24FB45833433255569204D1F57A6CF@G01JPEXMBYT05
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

From: Venkatesan, Sekhar [mailto:sekhar(dot)venkatesan(at)emc(dot)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

In response to

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Tsunakawa, Takayuki 2016-05-26 02:40:45 [patch] fix buffer overrun in logging, and code cleanup
Previous Message Venkatesan, Sekhar 2016-05-25 06:02:36 Re: PostgreSQL: SQLSetPos fails with SetPos update return error.