Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces
Greetings!  I'm new to this list, so if I over step some bounds or am
to the incorrect list, please bear with me.

I'm trying to write an interface to a Linux implementation of PostgreSQL
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
one of a run-time nature.  Whenever I try to connect to my Linux box, I
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
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,

pgsql-interfaces by date

Next:From: David O'FarrellDate: 1999-03-11 12:30:38
Subject: threads and libpq
Previous:From: Brian EldridgeDate: 1999-03-11 04:24:22
Subject: libpq problem

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group