libpq problem

From: Brian Eldridge <beldri(at)runesoft(dot)com>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: libpq problem
Date: 1999-03-11 04:28:14
Message-ID: 36E7465D.140665F3@runesoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Greetings! I'm new to this list, so if I over step some bounds or am
writing
to the incorrect list, please bear with me.

I'm trying to write an interface to a Linux implementation of PostgreSQL
6.4.2
from a Win 95 box. I downloaded the libpq.lib and it's cohorts for
6.4.2 for a
Windows 95 box. I'm having no trouble linking or compiling. My problem
is
one of a run-time nature. Whenever I try to connect to my Linux box, I
get
an "unknown host" error from libpq. If I use the psql.exe that came
with the libs,
it works fine. This is both, if I use an environment variable or use
the -h flag.
I can even connect using ODBC and MS Query, but whenever I try to
connect
with my homegrown prog, I get the invalid host error. Below is the code
I'm using
to connect:

pgdatabase = PQsetdb(szHost, szPort, NULL, NULL, szDatabase);

szHost, szPort, and szDatabase are all passed in. I've verified their
values, and
they are correct (i.e. the same values being passed to psql.exe). I've
gone as
far as to look at the psql.c file that came with my PostgreSQL source
and it does
a very similar call to PQsetdb:

settings.db = PQsetdb(host, port, NULL, NULL, dbname);

Any one have any idea why this might be happening?

Thanks in advance,
Brian

Browse pgsql-interfaces by date

  From Date Subject
Next Message David O'Farrell 1999-03-11 12:30:38 threads and libpq
Previous Message Brian Eldridge 1999-03-11 04:24:22 libpq problem