pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
libpq problem
6+ messages / 3 participants
[nested] [flat]

* libpq problem
@ 1999-03-11 04:24 Brian Eldridge <beldri@runesoft.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Brian Eldridge @ 1999-03-11 04:24 UTC (permalink / raw)
  To: 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





^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* libpq problem
@ 1999-03-11 04:28 Brian Eldridge <beldri@runesoft.com>
  1999-03-11 14:50 ` Re: [INTERFACES] libpq problem Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 6+ messages in thread

From: Brian Eldridge @ 1999-03-11 04:28 UTC (permalink / raw)
  To: 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






^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: [INTERFACES] libpq problem
  1999-03-11 04:28 libpq problem Brian Eldridge <beldri@runesoft.com>
@ 1999-03-11 14:50 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 1999-03-11 14:50 UTC (permalink / raw)
  To: Brian Eldridge <beldri@runesoft.com>; +Cc: pgsql-interfaces

Brian Eldridge <beldri@runesoft.com> writes:
> [on a Win 95 box] 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.

It kinda sounds like something is wrong with DNS lookup --- not on your
box as a whole, but just in your program.  Perhaps you are linking
against a broken resolver library, or some such?  Anyway, try putting
some debug printouts around the call to gethostbyname() in fe-connect.c;
I assume that must be the subroutine that's failing.  Find out what it's
being passed and what it's returning.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* libpq problem
@ 1999-07-27 09:53 Jonathan davis <haj@idianet.net>
  1999-07-27 14:22 ` Re: [INTERFACES] libpq problem Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 6+ messages in thread

From: Jonathan davis @ 1999-07-27 09:53 UTC (permalink / raw)
  To: pgsql-interfaces

hello,

with libpq, i can't difference between bad password and server down !!




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: [INTERFACES] libpq problem
  1999-07-27 09:53 libpq problem Jonathan davis <haj@idianet.net>
@ 1999-07-27 14:22 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 1999-07-27 14:22 UTC (permalink / raw)
  To: Jonathan davis <haj@idianet.net>; +Cc: pgsql-interfaces

"Jonathan davis" <haj@idianet.net> writes:
> with libpq, i can't difference between bad password and server down !!

Are you paying attention to PQerrorMessage?

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: [INTERFACES] libpq problem
@ 1999-07-27 15:46 Jonathan davis <haj@idianet.net>
  0 siblings, 0 replies; 6+ messages in thread

From: Jonathan davis @ 1999-07-27 15:46 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-interfaces


-

>"Jonathan davis" <haj@idianet.net> writes:
>> with libpq, i can't difference between bad password and server down !!
>
>Are you paying attention to PQerrorMessage?
>
> regards, tom lane
>
I means errors with code (int)




^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~1999-07-27 15:46 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-03-11 04:24 libpq problem Brian Eldridge <beldri@runesoft.com>
1999-03-11 04:28 libpq problem Brian Eldridge <beldri@runesoft.com>
1999-03-11 14:50 ` Tom Lane <tgl@sss.pgh.pa.us>
1999-07-27 09:53 libpq problem Jonathan davis <haj@idianet.net>
1999-07-27 14:22 ` Tom Lane <tgl@sss.pgh.pa.us>
1999-07-27 15:46 Re: [INTERFACES] libpq problem Jonathan davis <haj@idianet.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox