Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qBF1b-0007i0-A6 for pgsql-bugs@arkaria.postgresql.org; Mon, 19 Jun 2023 13:34:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qBF1a-00049W-7n for pgsql-bugs@arkaria.postgresql.org; Mon, 19 Jun 2023 13:34:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qBF1Z-00049M-SN for pgsql-bugs@lists.postgresql.org; Mon, 19 Jun 2023 13:34:29 +0000 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qBF1X-003Qry-DD for pgsql-bugs@lists.postgresql.org; Mon, 19 Jun 2023 13:34:29 +0000 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-5147e40bbbbso3572209a12.3 for ; Mon, 19 Jun 2023 06:34:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20221208.gappssmtp.com; s=20221208; t=1687181665; x=1689773665; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=l8Mu+ZXoWr/GWGfeHT3J4VrkJT1qskO+FMsiia6RXjI=; b=xC17av74MO7jL38uweqGUeRtYxpmWGoq/wNXOCmnATFueR6lK41nQXXHHul6mv0S9m 9t0nd6wNKILeUj/BkZ5wDgTxWbMInAOYqyHVJ5iAqLrbAemj+/Avf6SeeptyMAeetzqK WWeYx/2+A4W++51HVvioVXKvs7Aiy+ulBAN0KZyLEBgAis9tatocyUFpceZDlmpuW78k aiFzbGKdR897QA1qTm+ps9N0OHED44rrAFce4Z8GZDBLdOJydFaYqALVRjp+D9r+xx3C IMkZtvifnmiURVhcrQ1zDlbkH9NSt1QA6tHrxsg6RspN+RmynfmtlOIBxsewfWUiEJrN CMlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687181665; x=1689773665; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=l8Mu+ZXoWr/GWGfeHT3J4VrkJT1qskO+FMsiia6RXjI=; b=Z6k77pLg4En80f2WfhqhFwdWQ2FMwkea6FzixN/NRXsMUly51tyOtGmHiOlwk6PiL6 RHyNv5uvf1d9mnlFdAICFMKiwMCv5pBzfWFOnIVT+USSP14rjJ16Mhf+YiTj7RdsYNsf VoXsDBr2PpCqdnt5TJZNyvdZyYs6E9JXLnq1ulQVdTMBUfYPEfQift7fHkD8w1bQRn3l Oib1shz9HaRke5MMMu91b+1NArnyN4hJvhjN85xHU3lTxiPYMsztx3gR2gZ6XGPrjMaG q1k15QrH/Ug1HgtJRGcv/jSiQxz8tjtK+7PYhI4P+pVRahkN7qbagS3DpBk5QlJW9h6U Gg0g== X-Gm-Message-State: AC+VfDy2XP9rykQC38LXM6GjE38hUUMN06EyQLVZf/ERlpTlq4q4zmQ7 Eac+CHVjUnlCS0z9HLcSWx+LzhVRaiX8iafOD8g= X-Google-Smtp-Source: ACHHUZ7mw/88a+9Bw2QTNBV3JmPl35Asf742pXlmZ0iC7V+r0ehiRxa0FdWn8WHjGr4HgF/CzxwuFg== X-Received: by 2002:a05:6402:78d:b0:51a:3fda:8cfd with SMTP id d13-20020a056402078d00b0051a3fda8cfdmr4982647edy.14.1687181665384; Mon, 19 Jun 2023 06:34:25 -0700 (PDT) Received: from localhost.localdomain (62-46-249-34.adsl.highway.telekom.at. [62.46.249.34]) by smtp.gmail.com with ESMTPSA id bf25-20020a0564021a5900b0051a4361f3efsm2990323edb.61.2023.06.19.06.34.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jun 2023 06:34:25 -0700 (PDT) Message-ID: <54909d1223f527150f9c0e76efc581ded17e8e96.camel@cybertec.at> Subject: Re: BUG #17981: HY000 server closed the connection unexpectedly From: Laurenz Albe To: sayanoruspai@gmail.com, pgsql-bugs@lists.postgresql.org Date: Mon, 19 Jun 2023 15:34:24 +0200 In-Reply-To: <17981-984fdc9ec7e66b42@postgresql.org> References: <17981-984fdc9ec7e66b42@postgresql.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 (3.46.4-1.fc37) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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 g= et > 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 produ= ce > right answer and dead is returned equal to SQL_CD_FALSE. 08S01 is not a standard-defined SQLSTATE. The standard says: Subclass valu= es associated with such classes that begin with one of the s'5', '6', '= 7', '8', or '9' or one of the 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 implementatio= n- defined subclasses. A web search shows that 08S01 is MySQL-specific. I don't think that that i= s 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