Problem with unixODBC and PostgreSQL

From: Julie Reier <jreier(at)videologygroup(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Problem with unixODBC and PostgreSQL
Date: 2015-01-22 16:35:02
Message-ID: F81319CA-E3AA-4747-AD3F-3D7483DD3C69@videologygroup.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi. I am hoping that someone can advise me on an issue I am having with connecting to a postgresql DB via unixODBC.

I am using an ubuntu VM to test the configuration. Here’s what I did:

1. Installed unixODBC
2. Installed odbc-postgresql
3. Configured odbc drivers and data sources.

I am able to connect to the database via the psql command. However, osql is failing. Here’s the output:

rnduser(at)rnduser-VirtualBox:~$ osql -S rndredshift6 -U readonly -P *******

checking shared odbc libraries linked to isql for default directories...
strings: '': No such file
trying /tmp/sql ... no
trying /tmp/sql ... no
trying /etc ... OK
checking odbc.ini files
reading /home/rnduser/.odbc.ini
[rndredshift6] found in /home/rnduser/.odbc.ini
found this section:
[rndredshift6]
Driver = PostgreSQL
Description = data source for rndredshift
Server = 10.191.4.97
Port = 5439
Database = prod

looking for driver for DSN [rndredshift6] in /home/rnduser/.odbc.ini
found driver line: " Driver = PostgreSQL"
driver "PostgreSQL" found for [rndredshift6] in .odbc.ini
found driver named "PostgreSQL"
"PostgreSQL" is not an executable file
looking for entry named [PostgreSQL] in /etc/odbcinst.ini
found driver line: " Driver = /usr/lib/x86_64-linux-gnu/odbc/psqlodbca.so"
found driver /usr/lib/x86_64-linux-gnu/odbc/psqlodbca.so for [PostgreSQL] in odbcinst.ini
/usr/lib/x86_64-linux-gnu/odbc/psqlodbca.so is an executable file
"Server" found, not using freetds.conf
Server is "10.191.4.97"
looking up hostname for ip address 10.191.4.97
osql: warning: no DNS hostname found for "10.191.4.97"
Usage: host [-aCdlriTwv] [-c class] [-N ndots] [-t type] [-W time]
[-R number] [-m flag] hostname [server]
-a is equivalent to -v -t ANY
-c specifies query class for non-IN data
-C compares SOA records on authoritative nameservers
-d is equivalent to -v
-l lists all hosts in a domain, using AXFR
-i IP6.INT reverse lookups
-N changes the number of dots allowed before root lookup is done
-r disables recursive processing
-R specifies number of retries for UDP packets
-s a SERVFAIL response should stop query
-t specifies the query type
-T enables TCP/IP mode
-v enables verbose output
-w specifies to wait forever for a reply
-W specifies how long to wait for a reply
-4 use IPv4 query transport only
-6 use IPv6 query transport only
-m set memory debugging flag (trace|record|usage)
osql: no IP address found for ""
rnduser(at)rnduser-VirtualBox:~$

Telnet to 10.191.4.97 on port 5439 works.

Any ideas of what’s going on here?

Thanks,

Julie

This email is intended only for the use of the individual(s) to whom it is addressed. If you have received this communication in error, please immediately notify the sender and delete the original email.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrey Lizenko 2015-01-22 16:45:45 Re: temporary tables are logged somehow?
Previous Message Paul Jungwirth 2015-01-22 16:32:29 Re: how to duplicate data for few times by SQL command in PG