Basic connection problem

Basic connection problem

am 25.01.2007 18:23:07 von paul.a

I'm just trying to get going with an ODBC interface to Postgresql 8.1.5
on RHEL 3.0. I'm using the database without problems via psql, ecpg,
and JDBC.

I've hit the same problem using both iODBC and unixODBC driver
managers. It get the following when I try to connect to the database:

[08001][unixODBC]could not translate host name "port=5432" to address:
Name or service not known

[ISQL]ERROR: Could not SQLConnect

I've experimented with my ~/.odbc.ini file with and without Port = 5432
but can't seem to figure how port=5432 is even getting into the connect
string.

I've got psqlodbc 08.01.0200. I had to make a couple of small coding
changes to build it for iODBC but unixODBC worked fine with psqlodbc
code as downloaded.

I have unicode support turned on in the driver. My database uses UTF8.

Surely this must be a common problem. What am I doing wrong?

Paul


---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Re: Basic connection problem

am 25.01.2007 20:17:00 von Shelby Cain

I don't claim to be any expert using ODBC under Unix but It'd probably be h=
elpful if you post the relevant section from your odbc*.ini files...

http://www.unixodbc.org/odbcinst.html shows an example like so:

[PostgreSQL]
Description =3D Test to Postgres
Driver =3D PostgreSQL
Trace =3D Yes
TraceFile =3D sql.log
Database =3D nick
Servername =3D localhost
UserName =3D
Password =3D
Port =3D 5432
Protocol =3D 6.4
ReadOnly =3D No
RowVersioning =3D No
ShowSystemTables =3D No
ShowOidColumn =3D No
FakeOidIndex =3D No
ConnSettings =3D

Are you sure you have Servername specified correctly? The error message yo=
u are receiving leads me to believe "Port=3D5432" is somehow being confused=
for the database host server name.

Regards,

Shelby Cain

----- Original Message ----
From: Paul B. Anderson
To: pgsql-odbc@postgresql.org
Sent: Thursday, January 25, 2007 11:23:07 AM
Subject: [ODBC] Basic connection problem

I'm just trying to get going with an ODBC interface to Postgresql 8.1.5=20
on RHEL 3.0. I'm using the database without problems via psql, ecpg,=20
and JDBC.

I've hit the same problem using both iODBC and unixODBC driver=20
managers. It get the following when I try to connect to the database:

[08001][unixODBC]could not translate host name "port=3D5432" to address:=20
Name or service not known

[ISQL]ERROR: Could not SQLConnect

I've experimented with my ~/.odbc.ini file with and without Port =3D 5432=
=20
but can't seem to figure how port=3D5432 is even getting into the connect=
=20
string.

I've got psqlodbc 08.01.0200. I had to make a couple of small coding=20
changes to build it for iODBC but unixODBC worked fine with psqlodbc=20
code as downloaded.

I have unicode support turned on in the driver. My database uses UTF8.

Surely this must be a common problem. What am I doing wrong?

Paul


---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster





=20
____________________________________________________________ _______________=
_________
8:00? 8:25? 8:40? Find a flick in no time=20
with the Yahoo! Search movie showtime shortcut.
http://tools.search.yahoo.com/shortcuts/#news

---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate

Re: Basic connection problem

am 25.01.2007 20:28:38 von paul.a

Thanks. That was the problem. I had Host, not Servername. I used a
sample odbc.ini from iODBC as a pattern and it used Host.

Thanks again.

Paul


Shelby Cain wrote:
> I don't claim to be any expert using ODBC under Unix but It'd probably be helpful if you post the relevant section from your odbc*.ini files...
>
> http://www.unixodbc.org/odbcinst.html shows an example like so:
>
> [PostgreSQL]
> Description = Test to Postgres
> Driver = PostgreSQL
> Trace = Yes
> TraceFile = sql.log
> Database = nick
> Servername = localhost
> UserName =
> Password =
> Port = 5432
> Protocol = 6.4
> ReadOnly = No
> RowVersioning = No
> ShowSystemTables = No
> ShowOidColumn = No
> FakeOidIndex = No
> ConnSettings =
>
> Are you sure you have Servername specified correctly? The error message you are receiving leads me to believe "Port=5432" is somehow being confused for the database host server name.
>
> Regards,
>
> Shelby Cain
>
> ----- Original Message ----
> From: Paul B. Anderson
> To: pgsql-odbc@postgresql.org
> Sent: Thursday, January 25, 2007 11:23:07 AM
> Subject: [ODBC] Basic connection problem
>
> I'm just trying to get going with an ODBC interface to Postgresql 8.1.5
> on RHEL 3.0. I'm using the database without problems via psql, ecpg,
> and JDBC.
>
> I've hit the same problem using both iODBC and unixODBC driver
> managers. It get the following when I try to connect to the database:
>
> [08001][unixODBC]could not translate host name "port=5432" to address:
> Name or service not known
>
> [ISQL]ERROR: Could not SQLConnect
>
> I've experimented with my ~/.odbc.ini file with and without Port = 5432
> but can't seem to figure how port=5432 is even getting into the connect
> string.
>
> I've got psqlodbc 08.01.0200. I had to make a couple of small coding
> changes to build it for iODBC but unixODBC worked fine with psqlodbc
> code as downloaded.
>
> I have unicode support turned on in the driver. My database uses UTF8.
>
> Surely this must be a common problem. What am I doing wrong?
>
> Paul
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
>
>
>
>
>
>
> ____________________________________________________________ ________________________
> 8:00? 8:25? 8:40? Find a flick in no time
> with the Yahoo! Search movie showtime shortcut.
> http://tools.search.yahoo.com/shortcuts/#news
>
> .
>
>

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match