Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bKXtt-0007Hr-P8 for pgsql-odbc@arkaria.postgresql.org; Tue, 05 Jul 2016 21:29:02 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bKXtt-0000mt-Bv for pgsql-odbc@arkaria.postgresql.org; Tue, 05 Jul 2016 21:29:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bKXtX-0000O6-GG for pgsql-odbc@postgresql.org; Tue, 05 Jul 2016 21:28:39 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bKXtT-0001V1-J0 for pgsql-odbc@postgresql.org; Tue, 05 Jul 2016 21:28:39 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 4350A20290; Tue, 5 Jul 2016 17:28:32 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute5.internal (MEProxy); Tue, 05 Jul 2016 17:28:32 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=aklaver.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=slNtor9ZU15zNWiDgJyxXleZPew=; b=AJkuYM CXEgW+OR6d22BV43JnAN8nXMrInq4MqBJl1bKw/Ga5/wXEsixDBD0RRK98Nltx+e 51a1+He6RJYUeIJNwVJhjsJ9I//Q2Nzezkzx3en1yjUG6WnhsYXOb4yJD1Ie/BKd +Htxn8Hjco6mTduaYOc8irD2T4/WwfmHTZ2oo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=slNtor9ZU15zNWi DgJyxXleZPew=; b=mrC62MwFmC92sj4TmBW1bRGUSfLEOQFKi4Xj3pHjhnsVsEV YRLwyV2JYE+2dSIPystWRTBszSPjm0Xz0ltnxGmASXZRQrUIj1SarMItXh67lpnc P5BtGchxVaqxRis//UVqA3ze6z/R4UT5zisFYLZLnJfjWZeGIAVIPIw2mrws= X-Sasl-enc: KwyLJCgvUDupzrkb4KOKsRrnt63JpLKIPOqAgHGiTmgL 1467754111 Received: from [192.168.1.2] (174-24-160-10.tukw.qwest.net [174.24.160.10]) by mail.messagingengine.com (Postfix) with ESMTPA id 72C86CCDA6; Tue, 5 Jul 2016 17:28:31 -0400 (EDT) Subject: Re: How to get correct error message before logging to database To: Andrus , pgsql-odbc@postgresql.org References: <6BCE831703094A8287071F2E5DAB4C8C@dell2> <292539c2-5a39-0b56-fb9f-2ec2e13b0674@aklaver.com> <48fa3b3c-462c-2b2d-7dc9-c0f08883db5e@aklaver.com> From: Adrian Klaver Message-ID: <07661375-bd1c-c19a-e5f1-460fc9dc3376@aklaver.com> Date: Tue, 5 Jul 2016 14:28:30 -0700 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1257; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-odbc Precedence: bulk Sender: pgsql-odbc-owner@postgresql.org On 07/05/2016 01:42 PM, Andrus wrote: > Hi! > >> That is many versions past. The only thing I can think of at the >> moment is: >> https://odbc.postgresql.org/docs/release.html >> psqlODBC 09.05.0100 Release >> Changes: >> Use libpq for all communication with the server >> Previously, libpq was only used for authentication. Using it for >> all communication lets us remove a lot of duplicated code. libpq is >> now required for building or using libpq. >> You might try the version immediately preceding the above: >> psqlODBC 09.03.0400 >> to see if you get the old behavior or new. > > 09.03.0400 returns proper error message on login with invalid server > address: > > could not translate host name "xxx" to address: Unknown host > > AERROR() returns also sql error code. > > How to get proper error message in 09.05.0300 ? > Maybe libpq does not return error messages before connection is > established. Well it is using libpq for authentication on 09.03.0400, which is the part that is going to throw the errors. Also psql, which uses libpq does this: aklaver@panda:~> psql -d test -U aklaver -W -h host Password for user aklaver: psql: could not translate host name "host" to address: Name or service not known aklaver@panda:~> psql -d test -U aklaver -W -h localhost Password for user aklaver: psql: FATAL: password authentication failed for user "aklaver" FATAL: password authentication failed for user "aklaver" So I am thinking this not a libpq issue, but a change in error reporting when the code was reorganized in 09.05.0100. I do not know the internals well enough to say anything more. Hopefully someone that does can fill in the blanks. ` > I can post odbc log if this helps. > > Andrus. -- Adrian Klaver adrian.klaver@aklaver.com -- Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc