From: Stefan Viljoen <viljoens@verishare.co.za>
To: pgsql-odbc@postgresql.org
Subject: Re: Postgres 9.4 + unixODBC on Centos 6.5 problem connecting localhost postgres instance with isql ODBC commandline client
Date: Wed, 22 Jul 2015 09:22:27 +0200
Message-ID: <000601d0c44f$299d9cc0$7cd8d640$@verishare.co.za> (raw)
In-Reply-To: <27855.1437485650@sss.pgh.pa.us>
References: <000b01d0c066$c58f3b80$50adb280$@verishare.co.za>
<55A8BF02.4090001@lurcher.org>
<002701d0c07f$bd09f3b0$371ddb10$@verishare.co.za>
<55A8E0B8.3070107@lurcher.org>
<002e01d0c088$c6b57390$54205ab0$@verishare.co.za>
<55A8F948.9040407@lurcher.org>
<002f01d0c090$da03cc50$8e0b64f0$@verishare.co.za>
<55A905FA.2080701@aklaver.com>
<003001d0c099$e21a7b60$a64f7220$@verishare.co.za>
<55A90E6A.4030802@lurcher.org>
<003201d0c09f$b1ece5d0$15c6b170$@verishare.co.za>
<55BAADA01D8C504993894EAEA7517CF8124630@003FCH1MPN2-002.003f.mgd2.msft.net>
<000d01d0c2b8$a8f146e0$fad3d4a0$@verishare.co.za>
<004501d0c2d8$5a4cc710$0ee65530$@verishare.co.za>
<55BAADA01D8C504993894EAEA7517CF81246C6@003FCH1MPN2-002.003f.mgd2.msft.net>
<004601d0c2db$2d38ade0$87aa09a0$@verishare.co.za>
<55BAADA01D8C504993894EAEA7517CF81246DB@003FCH1MPN2-002.003f.mgd2.msft.net>
<004a01d0c2e4$ad416320$07c42960$@verishare.co.za>
<55ACE4C5.2030704@lurcher.org>
<005101d0c2eb$ae674150$0b35c3f0$@verishare.co.za>
<55ACF2B9.202! 0805@lu rc her.org>
<0 00401d0c387$45071e00$cf155a00$@verishare.co.za>
<27855.1437485650@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-odbc>
Hi Tom
Thanks for replying.
>Hm, I just noticed this bit:
> Protocol=9.4
>Others with more ODBC experience can correct me, but I suspect that the
ODBC driver has no idea what to do with that value. The PG wire protocol
hasn't changed since 7.4, and I thought that "7.4" was generally the right
thing to use there.
Ok, I replaced the
Protocol=9.4
line with
Protocol=7.4
and then tried isql again, still receiving the same error.
---
[S1000][unixODBC]The database does not exist on the server
or user authentication failed.
---
>Also, have you tried looking into the resulting TraceFile and/or DebugFile?
You'd probably have to modify
>DebugFile=/var/log/postgresql_debug.log
>as I sure hope /var/log is not writable to you.
I changed these paths to point to
TraceFile=/tmp/odbc_trace.log
DebugFile=/tmp/odbc_debug.log
and then tried to run isql again, error remains the same, AND neither of
these log files are created.
I did notice though that there is a file /tmp/mylog_postgres23427.log that
was last written on the 17th (that's when I started to try to get Postgres
9.4 to communicate over ODBC) but hasn't been updated since.
That file contains:
---
[140298388883200]calling getDSNdefaults
[140298388883200]CC_connect: entering...
[140298388883200]sslmode=disable
[140298388883200]original_CC_connect: entering...
[140298388883200]Driver Version='09.03.0400,Apr 5 2015'
[140298388883200]original_CC_connect: DSN = 'pgdb-cdr', server =
'localhost', port = '5432', database = 'asteriskcdrdb', username =
'asteriskcdruser', password='xxxxx'
[140298388883200]connecting to the server socket...
[140298388883200](0)(null) ERRNO=115
[140298388883200]connection to the server socket succeeded.
[140298388883200]sizeof startup packet = 292
[140298388883200]sent the authentication block successfully.
[140298388883200]gonna do authentication
[140298388883200]read -1, global_socket_buffersize=4096
[140298388883200]Lasterror=11
[140298388883200]!!! poll ret=1 revents=1
[140298388883200]read 9, global_socket_buffersize=4096
[140298388883200]auth got 'R'
[140298388883200]areq = 5 salt=fcc6a94100
[140298388883200]in AUTH_REQ_MD5
[140298388883200]read -1, global_socket_buffersize=4096
[140298388883200]Lasterror=11
[140298388883200]!!! poll ret=1 revents=1
[140298388883200]read 15, global_socket_buffersize=4096
[140298388883200]auth got 'R'
[140298388883200]areq = 0 salt=0000000000
[140298388883200]sending an empty query...
[140298388883200]CC_send_query: conn=0x18aaf20, query=' '
[140298388883200]send_query: done sending query 3bytes flushed
[140298388883200]in QR_Constructor
[140298388883200]exit QR_Constructor
[140298388883200]send_query: got id = 'K'
[140298388883200]CC_error_statements: self=0x18aaf20
[140298388883200]CONN ERROR: func=CC_send_query, desc='', errnum=106,
errmsg='Unexpected protocol character from backend (send_query)'
[140298388883200]CC_on_abort in
[140298388883200]SOCK_Destructor
[140298388883200]send_query: error - Unexpected protocol character from
backend (send_query)
[140298388883200]CC_on_abort in
[140298388883200]QResult: enter DESTRUCTOR
[140298388883200]QResult: in QR_close_result
[140298388883200]QResult: free memory in, fcount=0
[140298388883200]QResult: free memory out
[140298388883200]QResult: exit close_result
[140298388883200]QResult: exit DESTRUCTOR
[140298388883200]CC_error_statements: self=0x18aaf20
[140298388883200]CONN ERROR: func=original_CC_connect, desc='', errnum=105,
errmsg='The database does not exist on the server
or user authentication failed.'
[140298388883200]QResult: enter DESTRUCTOR
[140298388883200]CONN ERROR: func=PGAPI_Connect, desc='Error on CC_connect',
errnum=105, errmsg='The database does not exist on the server
or user authentication failed.'
[140298388883200]PGAPI_Connect: returning..-1.
[140298388883200][[SQLGetDiagRec]]
[140298388883200]PGAPI_GetDiagRec entering type=2 rec=1
[140298388883200]**** PGAPI_ConnectError: hdbc=0x18aaf20 <513>
[140298388883200]enter CC_get_error
[140298388883200]enter CC_create_errormsg
[140298388883200]msg = 'The database does not exist on the server
or user authentication failed.'
[140298388883200]exit CC_create_errormsg
[140298388883200]exit CC_get_error
[140298388883200]CC_get_error: status = 105, msg = #The database does not
exist on the server
or user authentication failed.#
[140298388883200] szSqlState = 'S1000',len=72, szError='The
database does not exist on the server
or user authentication failed.'
[140298388883200]PGAPI_GetDiagRec exiting 0
[140298388883200][[SQLGetDiagRec]]
[140298388883200]PGAPI_GetDiagRec entering type=2 rec=2
[140298388883200]**** PGAPI_ConnectError: hdbc=0x18aaf20 <513>
[140298388883200]PGAPI_GetDiagRec exiting 100
[140298388883200][[SQLFreeHandle]][140298388883200]PGAPI_FreeConnect:
entering...
[140298388883200]**** in PGAPI_FreeConnect: hdbc=0x18aaf20
[140298388883200]enter CC_Destructor, self=0x18aaf20
[140298388883200]in CC_Cleanup, self=0x18aaf20
[140298388883200]after SOCK destructor
[140298388883200]CC_conninfo_init opt=1
[140298388883200]exit CC_Cleanup
[140298388883200]after CC_Cleanup
[140298388883200]after free statement holders
[140298388883200]exit CC_Destructor
[140298388883200]PGAPI_FreeConnect: returning...
[140298388883200][[SQLFreeHandle]][140298388883200]**** in PGAPI_FreeEnv:
env = 0x18a9a40 **
[140298388883200]in EN_Destructor, self=0x18a9a40
[140298388883200]clearing conns count=128
[140298388883200]exit EN_Destructor: rv = 1
[140298388883200] ok
---
This looks like pretty relevant (don't know why it does not have amore
recent date though?) but relevant errors appear to be:
---
[140298388883200]send_query: got id = 'K'
[140298388883200]CC_error_statements: self=0x18aaf20
[140298388883200]CONN ERROR: func=CC_send_query, desc='', errnum=106,
errmsg='Unexpected protocol character from backend (send_query)'
[140298388883200]CC_on_abort in
[140298388883200]SOCK_Destructor
[140298388883200]send_query: error - Unexpected protocol character from
backend (send_query)
[140298388883200]CC_on_abort in
---
and this clearly is happening on my connection attempts?
This line
[140298388883200]send_query: error - Unexpected protocol character from
backend (send_query)
does eem to indicated that somehow the ODBC driver Postgres provides is
incompatible on protocol level with unixODBC's isql application, at least in
my instance here...?
Thanks
Regards
Stefan
--
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: viljoens@verishare.co.za
Subject: Re: Postgres 9.4 + unixODBC on Centos 6.5 problem connecting localhost postgres instance with isql ODBC commandline client
In-Reply-To: <000601d0c44f$299d9cc0$7cd8d640$@verishare.co.za>
References: <000b01d0c066$c58f3b80$50adb280$@verishare.co.za> <55A8E0B8.3070107@lurcher.org> <002e01d0c088$c6b57390$54205ab0$@verishare.co.za> <55A8F948.9040407@lurcher.org> <002f01d0c090$da03cc50$8e0b64f0$@verishare.co.za> <55A905FA.2080701@aklaver.com> <003001d0c099$e21a7b60$a64f7220$@verishare.co.za> <55A90E6A.4030802@lurcher.org> <003201d0c09f$b1ece5d0$15c6b170$@verishare.co.za> <55BAADA01D8C504993894EAEA7517CF8124630@003FCH1MPN2-002.003f.mgd2.msft.net> <000d01d0c2b8$a8f146e0$fad3d4a0$@verishare.co.za> <004501d0c2d8$5a4cc710$0ee65530$@verishare.co.za> <55BAADA01D8C504993894EAEA7517CF81246C6@003FCH1MPN2-002.003f.mgd2.msft.net> <004601d0c2db$2d38ade0$87aa09a0$@verishare.co.za> <55BAADA01D8C504993894EAEA7517CF81246DB@003FCH1MPN2-002.003f.mgd2.msft.net> <004a01d0c2e4$ad416320$07c42960$@verishare.co.za> <55ACE4C5.2030704@lurcher.org> <005101d0c2eb$ae674150$0b35c3f0$@verishare.co.za> <27855.1437485650@sss.pgh.pa.us> <000601d0c44f$299d9cc0$7cd8d640$@verishare.co.za>
* 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