SQLError SqlState wrong when postgres backend dies - Mailing list pgsql-odbc

From Jeremy Faith
Subject SQLError SqlState wrong when postgres backend dies
Date
Msg-id CO1P132MB000639ADBF6C92A86BDE833B85C80@CO1P132MB0006.NAMP132.PROD.OUTLOOK.COM
Whole thread Raw
Responses Re: SQLError SqlState wrong when postgres backend dies
List pgsql-odbc

Hi,


The SQLError function is returning the last statement level SqlState value if called after the postgres backend dies.

For exampel, if prior to the death of the postgres backend the last SQL statement that had an error returned an SqlState="23505"(due to a unique index problem) then after the postgres backend dies the next SQL statement will fail and SQLError returns:-

  NativeError=26 SqlState="23505" ErrorMsg=Could not send Query(connection dead)

So ErrorMsg is correct but SqlState is not.


I was using psqlodbc-09.05.0400 but repeated my test with 10.01.0000 and got the same result.


Note:I know SQLError is deprecated and that SQLGetDiagRec should be used instead but I have a comment in my code that indicates I was getting a segfault with the postgres ODBC driver when I used SQLGetDiagRec(this would have been from some years ago).


Regards,

Jeremy Faith

pgsql-odbc by date:

Previous
From: "Inoue, Hiroshi"
Date:
Subject: Re: Patch for an encoding bug in the derive_locale_encoding function
Next
From: Farhana Reid
Date:
Subject: help with downloading postgres server and client