Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZHoPi-0006fX-Di for pgsql-odbc@arkaria.postgresql.org; Wed, 22 Jul 2015 07:26:02 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZHoPh-0004Yc-Uu for pgsql-odbc@arkaria.postgresql.org; Wed, 22 Jul 2015 07:26: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) (envelope-from ) id 1ZHoPK-0003ii-D9 for pgsql-odbc@postgresql.org; Wed, 22 Jul 2015 07:25:38 +0000 Received: from mail.verishare.co.za ([217.29.208.2]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZHoJH-0006f9-Fg for pgsql-odbc@postgresql.org; Wed, 22 Jul 2015 07:19:31 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.verishare.co.za (Postfix) with ESMTP id A97FD4216D8 for ; Wed, 22 Jul 2015 09:19:16 +0200 (SAST) Received: from mail.verishare.co.za ([127.0.0.1]) by localhost (mail.verishare.co.za [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id YdND9cbsdmoD; Wed, 22 Jul 2015 09:19:16 +0200 (SAST) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.verishare.co.za (Postfix) with ESMTP id 457B5421F37; Wed, 22 Jul 2015 09:19:16 +0200 (SAST) X-Virus-Scanned: amavisd-new at verishare.co.za Received: from mail.verishare.co.za ([127.0.0.1]) by localhost (mail.verishare.co.za [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id hD-JV9qlpN7n; Wed, 22 Jul 2015 09:19:16 +0200 (SAST) Received: from STEFANPC (unknown [172.16.1.76]) by mail.verishare.co.za (Postfix) with ESMTPSA id 25E2F4216D8 for ; Wed, 22 Jul 2015 09:19:16 +0200 (SAST) From: "Stefan Viljoen" To: 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> In-Reply-To: <27855.1437485650@sss.pgh.pa.us> 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> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQIlJsTM6eABCGiGgETx/eeRTV0aKQD+sBlEAd+uLVACvS0eZwIDK6DSAbi5yQACNRVlIgKyOovEAwQzP6cC5YclzgJpmRobAc/BjzoBf0NcHwGnPLYpAkwTS5MBk03d/wG9jGHvAr6SG74B/EZIOQDrtGsTAcbeL70CNY4bRADQOLotm+GIOqA= Content-Language: en-za X-Pg-Spam-Score: -3.1 (---) 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 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