pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: sayanoruspai@gmail.com
To: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17981: HY000 server closed the connection unexpectedly
Date: Mon, 19 Jun 2023 15:34:24 +0200
Message-ID: <54909d1223f527150f9c0e76efc581ded17e8e96.camel@cybertec.at> (raw)
In-Reply-To: <17981-984fdc9ec7e66b42@postgresql.org>
References: <17981-984fdc9ec7e66b42@postgresql.org>

On Mon, 2023-06-19 at 11:52 +0000, PG Bug reporting form wrote:
> I am writing an application that connects to the local database through
> psqlodbc version 13.02. And when I manually stop my database service, I get
> sqlstate HY000 and message 'server closed the connection unexpectedly ...'.
> Should not it be something like 08S01? Also SQLGetConnectAttr(GetHandle(),
> SQL_ATTR_CONNECTION_DEAD, &dead, SQL_IS_INTEGER, nullptr); does not produce
> right answer and dead is returned equal to SQL_CD_FALSE.

08S01 is not a standard-defined SQLSTATE.  The standard says: Subclass values
associated with such classes that begin with one of the <digit>s'5', '6', '7',
'8', or '9' or one of the <simple Latin upper case letter>s 'I', 'J', 'K', 'L',
'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', or 'Z' are
reserved for implementation-defined conditions and are called implementation-
defined subclasses.

A web search shows that 08S01 is MySQL-specific.  I don't think that that is
necessarily better than HY000, which is defined as an unspecified C API
error by the SQL standard.

About SQLGetConnectAttr, you should probably ask the ODBC mailing list
pgsql-odbc@postgresql.org

Yours,
Laurenz Albe





view thread (2+ messages)

Message-ID: <54909d1223f527150f9c0e76efc581ded17e8e96.camel@cybertec.at>
Permalink:  ../54909d1223f527150f9c0e76efc581ded17e8e96.camel@cybertec.at/
Also on:    postgresql.org/message-id/54909d1223f527150f9c0e76efc581ded17e8e96.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: laurenz.albe@cybertec.at, sayanoruspai@gmail.com
  Subject: Re: BUG #17981: HY000 server closed the connection unexpectedly
  In-Reply-To: <54909d1223f527150f9c0e76efc581ded17e8e96.camel@cybertec.at>
  References: <17981-984fdc9ec7e66b42@postgresql.org> <54909d1223f527150f9c0e76efc581ded17e8e96.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox