Thread: delete fails due to referential integrity, but return code is 0.

delete fails due to referential integrity, but return code is 0.

From
Leonid Furman
Date:
Hello,

I am using PostgreSql on Windows NT 4.0 service pack 5.
PostgreSQL version is  PostgreSQL 7.0.0 on i686-pc-cygwin, compiled by gcc
egcs-2.91.57.
The client is an ODBC program which connects to the backend using odbc
driver version 6.50.00.00.

When deleting a record from table A referenced in table B: "delete from A
where id = 1001" using SQLExectDirect() the call returns 0 (this is wrong),
while the record is not deleted from table A (this is right)

Executing the same SQL statement from psql returns:

ERROR:  <unnamed> referential integrity violation - key in A still
referenced from B.

Thank you,

Leonid Furman.