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: Fri, 17 Jul 2015 16:27:25 +0200
Message-ID: <003101d0c09c$b3e49e80$1baddb80$@verishare.co.za> (raw)
In-Reply-To: <55A90B50.6080601@lurcher.org>
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>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-odbc>
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
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: <003101d0c09c$b3e49e80$1baddb80$@verishare.co.za>
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> <003101d0c09c$b3e49e80$1baddb80$@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