From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Andrus <kobruleht2@hot.ee>
To: pgsql-odbc@postgresql.org
Subject: Re: How to get correct error message before logging to database
Date: Tue, 5 Jul 2016 14:28:30 -0700
Message-ID: <07661375-bd1c-c19a-e5f1-460fc9dc3376@aklaver.com> (raw)
In-Reply-To: <A302DD938A9B4CBC80B61456ECFF5DD6@dell2>
References: <6BCE831703094A8287071F2E5DAB4C8C@dell2>
<292539c2-5a39-0b56-fb9f-2ec2e13b0674@aklaver.com>
<AA524971917A4C25AD1EAF6EA49D2557@dell2>
<48fa3b3c-462c-2b2d-7dc9-c0f08883db5e@aklaver.com>
<A302DD938A9B4CBC80B61456ECFF5DD6@dell2>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-odbc>
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
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-odbc@postgresql.org
Cc: adrian.klaver@aklaver.com, kobruleht2@hot.ee
Subject: Re: How to get correct error message before logging to database
In-Reply-To: <07661375-bd1c-c19a-e5f1-460fc9dc3376@aklaver.com>
References: <6BCE831703094A8287071F2E5DAB4C8C@dell2> <292539c2-5a39-0b56-fb9f-2ec2e13b0674@aklaver.com> <AA524971917A4C25AD1EAF6EA49D2557@dell2> <48fa3b3c-462c-2b2d-7dc9-c0f08883db5e@aklaver.com> <A302DD938A9B4CBC80B61456ECFF5DD6@dell2> <07661375-bd1c-c19a-e5f1-460fc9dc3376@aklaver.com>
* 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