SQLError SqlState wrong when postgres backend dies

From: Jeremy Faith <jeremy(dot)faith(at)jci(dot)com>
To: "pgsql-odbc(at)postgresql(dot)org" <pgsql-odbc(at)postgresql(dot)org>
Subject: SQLError SqlState wrong when postgres backend dies
Date: 2018-02-19 11:42:36
Message-ID: CO1P132MB000639ADBF6C92A86BDE833B85C80@CO1P132MB0006.NAMP132.PROD.OUTLOOK.COM
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Farhana Reid 2018-02-20 14:43:44 help with downloading postgres server and client
Previous Message Inoue, Hiroshi 2018-02-14 00:25:22 Re: Patch for an encoding bug in the derive_locale_encoding function