Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZG6Yk-0003UY-2Z for pgsql-odbc@arkaria.postgresql.org; Fri, 17 Jul 2015 14:24:18 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZG6Yj-0004d8-ES for pgsql-odbc@arkaria.postgresql.org; Fri, 17 Jul 2015 14:24:17 +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 1ZG6Yj-0004d1-1L for pgsql-odbc@postgresql.org; Fri, 17 Jul 2015 14:24:17 +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 1ZG6Yf-0002Hv-3P for pgsql-odbc@postgresql.org; Fri, 17 Jul 2015 14:24:16 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.verishare.co.za (Postfix) with ESMTP id D0EAB42177D for ; Fri, 17 Jul 2015 16:24:09 +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 xZgfxnK7D2d9; Fri, 17 Jul 2015 16:24:09 +0200 (SAST) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.verishare.co.za (Postfix) with ESMTP id 430B6422316; Fri, 17 Jul 2015 16:24:09 +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 ZHdMUEPm-YPJ; Fri, 17 Jul 2015 16:24:09 +0200 (SAST) Received: from STEFANPC (unknown [172.16.1.76]) by mail.verishare.co.za (Postfix) with ESMTPSA id 2BFAA42177D for ; Fri, 17 Jul 2015 16:24:09 +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> <55A90B50.6080601@lurcher.org> In-Reply-To: <55A90B50.6080601@lurcher.org> Subject: Re: Postgres 9.4 + unixODBC on Centos 6.5 problem connecting localhost postgres instance with isql ODBC commandline client Date: Fri, 17 Jul 2015 16:27:25 +0200 Message-ID: <003101d0c09c$b3e49e80$1baddb80$@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+uLVACvS0eZwIDK6DSAbi5yQACNRVlIgGC7CCPnM5rp/A= Content-Language: en-za X-Pg-Spam-Score: -2.6 (--) 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 again Nick >Another thing to check is that the driver is reading the same ini file as the driver manager. >What error do you get from >isql -v pgdb-cdr dbuser password I get --- [root@jhbasterisk pg_log]# isql -v pgdb-cdr dbuser password [S1000][unixODBC]The database does not exist on the server or user authentication failed. [ISQL]ERROR: Could not SQLConnect [root@jhbasterisk pg_log]# --- >It may be the driver (the folks on this list will know better that I do) is reading the ini file itself, so it may be looking elsewhere (instead of using the libodbcinst.so helper lib). >Try setting >export ODBCINI=/path/to/odbc.ini Ok, I tried that --- [root@jhbasterisk pg_log]# export ODBCINI=/etc/odbc.ini [root@jhbasterisk pg_log]# isql -v pgdb-cdr asteriskcdruser 1ndestruc# [S1000][unixODBC]The database does not exist on the server or user authentication failed. [ISQL]ERROR: Could not SQLConnect [root@jhbasterisk pg_log]# set | grep ODBCINI ODBCINI=/etc/odbc.ini [root@jhbasterisk pg_log]# --- so I get the same error , and ODBCINI is set in the environment after exporting the symbol ODBCINI - odbc.ini IS in /etc: --- [root@jhbasterisk pg_log]# ls /etc/odbc.ini -l -rw-r--r-- 1 root root 646 Jul 17 16:00 /etc/odbc.ini [root@jhbasterisk pg_log]# --- >That may help. also try removing the white space before and after the = Ok, I removed whitespace in the postgress - relevant lines in odbcinst.ini and odbc.ini - the now look like this: /etc/odbcinst.ini: --- # Example driver definitions # Driver from the postgresql-odbc package # Setup from the unixODBC package [PostgreSQL] Description=ODBC for PostgreSQL ;Driver = /usr/lib/psqlodbc.so Driver=/usr/pgsql-9.4/lib/psqlodbc.so Setup=/usr/lib/libodbcpsqlS.so ;Driver64 = /usr/lib64/psqlodbc.so Driver64=/usr/pgsql-9.4/lib/psqlodbc.so Setup64=/usr/lib64/libodbcpsqlS.so FileUsage=1 # Driver from the mysql-connector-odbc package # Setup from the unixODBC package [MySQL] Description = ODBC for MySQL Driver = /usr/lib/libmyodbc5.so Setup = /usr/lib/libodbcmyS.so Driver64 = /usr/lib64/libmyodbc5.so Setup64 = /usr/lib64/libodbcmyS.so FileUsage = 1 --- /etc/odbc.ini: --- [ODBC Data Sources] pgdb=PostgreSQL [asterisk-cdr] Description=MySQL connector for Asterisk Driver=MySQL Database=asteriskcdrdb Socket=/var/lib/mysql/mysql.sock [pgdb-cdr] ;Driver = /usr/pgsql-9.4/lib/psqlodbc.so Driver=PostgreSQL ServerName=localhost Port=5432 UserName=asteriskcdruser Password=1ndestruc# Database=asteriskcdrdb ReadOnly=No Protocol=9.4 Trace=Yes TraceFile=/tmp/sql.log ConnSettings= DSN=pgdb ServerType=Postgres Debug=1 DebugFile=/var/log/postgresql_debug.log --- The error remains the same, after restarting postgress (which should not have any effect nonetheless): [root@jhbasterisk pg_log]# isql -v pgdb-cdr asteriskcdruser 1ndestruc# [S1000][unixODBC]The database does not exist on the server or user authentication failed. [ISQL]ERROR: Could not SQLConnect [root@jhbasterisk pg_log]# psql still works: [root@jhbasterisk pg_log]# psql -U asteriskcdruser -d asteriskcdrdb psql (9.4.4) Type "help" for help. asteriskcdrdb=> but that is because it does not try to use ODBC. Thanks a lot for the help. Kind 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