Re: DIAG [HY000] server closed the connection unexpectedly

From: "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>
To: 'Jon Raiford' <Raiford(at)labware(dot)com>
Cc: "pgsql-odbc(at)postgresql(dot)org" <pgsql-odbc(at)postgresql(dot)org>
Subject: Re: DIAG [HY000] server closed the connection unexpectedly
Date: 2016-10-21 02:32:12
Message-ID: 0A3221C70F24FB45833433255569204D1F6349C4@G01JPEXMBYT05
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Hi, Jon, Inoue-san,

Inoue-san,
The attached patch is rebased on HEAD.

Jon,

From: Jon Raiford [mailto:Raiford(at)labware(dot)com]
> Yes, I can see that the code does answer 08S01, however it is being reported
> as 08001 to the application. This can be seen even in the ODBC trace. I'm
> not sure why it is changed. Maybe this is a symptom of a bigger problem?

Didn't the 08001 get returned after you failed to reconnect? As follows, I got 08S01 when I killed backend while it was running an SQL statement (e.g. SELECT pg_sleep(1000)).

[isql command of unixODBC]
$ isql -v postgres
...
SQL> select pg_sleep(1000);
[ISQL]ERROR: Could not SQLExecute
[08S01]server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
;
The connection has been lost
SQL>

[my test app using SQLExecDirect]
08S01: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
;
The connection has been lost

Regards
Takayuki Tsunakawa

Attachment Content-Type Size
sqlstate_on_disconnection_v2.patch application/octet-stream 4.2 KB

In response to

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Tsunakawa, Takayuki 2016-10-21 06:24:45 [RFC] Changing the default of UseDeclareFetch and Protocol (statement -> transaction rollback)
Previous Message Fred Parkinson 2016-10-20 15:43:25 Re: xmin when linked tables are updated?