Re: Postgres 9.4 + unixODBC on Centos 6.5 problem connecting localhost postgres instance with isql ODBC commandline client - Mailing list pgsql-odbc

From Nick Gorham
Subject Re: Postgres 9.4 + unixODBC on Centos 6.5 problem connecting localhost postgres instance with isql ODBC commandline client
Date
Msg-id 55A90E6A.4030802@lurcher.org
Whole thread Raw
In response to Re: Postgres 9.4 + unixODBC on Centos 6.5 problem connecting localhost postgres instance with isql ODBC commandline client  ("Stefan Viljoen" <viljoens@verishare.co.za>)
Responses Re: Postgres 9.4 + unixODBC on Centos 6.5 problem connecting localhost postgres instance with isql ODBC commandline client  ("Stefan Viljoen" <viljoens@verishare.co.za>)
List pgsql-odbc
On 17/07/15 15:07, Stefan Viljoen wrote:
> Hi Adrian
>
> Thanks for replying!
>
>> So what does your odbcinst.ini file look like?
> Here is my odbcinst.ini file, as automatically created when installing the
> postgresql-odbc package in Centos 6.5 via YUM:
>
> ---
> # Example driver definitions
>
> # Driver from the postgresql-odbc package
> # Setup from the unixODBC package
> [PostgreSQL]
> Description     = ODBC for PostgreSQL
> Driver          = /usr/pgsql-9.4/lib/psqlodbc.so
> Setup           = /usr/lib/libodbcpsqlS.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
> ---
>
>> What happens if you temporarily change the authentication to trust in
> pg_hba.conf and after reloading the Postgres server try to connect?
>
> [root@jhbasterisk pg_log]# vim ../pg_hba.conf
>
> Change to read like this:
>
> ---
> local   all             all                                     trust
> host    all             all             127.0.0.1/32            trust
> host    all             all             ::1/128                 trust
> ---
>
> [root@jhbasterisk pg_log]# service postgresql-9.4 restart
> Stopping postgresql-9.4 service:                           [  OK  ]
> Starting postgresql-9.4 service:                           [  OK  ]
> [root@jhbasterisk pg_log]# isql -vvvvvv pgdb-cdr dbuser password
> [S1000][unixODBC]The database does not exist on the server
> or user authentication failed.
> [ISQL]ERROR: Could not SQLConnect

Getting confused now. The above leads me to believe you should have

Database                = asteriskcdrcdrdb

in the odbc.ini entry and connect as

isql -v pgdb-cdr asteriskcdruser whateverthepasswordis

I was assuming you were replacing dbuser, dbname and password with the real ones for your situation.

--
Nick


pgsql-odbc by date:

Previous
From: Nick Gorham
Date:
Subject: Re: Postgres 9.4 + unixODBC on Centos 6.5 problem connecting localhost postgres instance with isql ODBC commandline client
Next
From: "Stefan Viljoen"
Date:
Subject: Re: Postgres 9.4 + unixODBC on Centos 6.5 problem connecting localhost postgres instance with isql ODBC commandline client