RE: [INTERFACES] Win32 interface - Mailing list pgsql-interfaces

From Magnus Hagander
Subject RE: [INTERFACES] Win32 interface
Date
Msg-id 215896B6B5E1CF11BC5600805FFEA82101F7105F@sirius.edu.sollentuna.se
Whole thread Raw
Responses Re: [INTERFACES] Win32 interface  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-interfaces
It does just that.

The problem is that in the DllMain() of the libpq.dll file, WSAStartup() is
called, and that is required before any winsock functions will work.
If you link statically, you have to manually run WSAStartup.

This should probably be documented :-)

//Magnus

On Friday, September 03, 1999 10:27 PM, David Giffin
[SMTP:david@agent911.com] wrote:
> 
> I figured out what was happening... Or at least what seem to happen. When
> I linked in lipq.lib it would return unknown hostname. I switched it to
> the libpqdll.lib and it worked fine.
> 
> I thought that libpq.lib would statically complie postgres into the .exe
> but it didn't seem to work.
> 
> David
> 
> On Fri, 3 Sep 1999, Tom Lane wrote:
> 
> > David Giffin <david@agent911.com> writes:
> > > Yep I'm using the PQconnectDB("host=blah user=blah dbname=blah");
> > > I noticed that psql.c uses the PQsetdbLogin maybe I should switch to
that
> > > function if this one is broken? Would have to parse a little extra
but..
> > >>>> 
> > >>>> connectDB() --  unknown hostname: mobile
> > 
> > Assuming that "mobile" is the hostname you gave it, then parsing the
> > connectinfo string is not the problem.
> > 
> > The error message is coming out because gethostbyname() is failing ---
> > cf. connectDB() in interfaces/libpq/fe-connect.c.  (Or, perchance,
> > it is succeeding but delivering a non-INET address?  Seems unlikely
> > but if your LAN runs on non-TCP protocols then that's possible.)
> > 
> > My guess is that there is something broken with DNS name resolution
> > on your setup.  Hard to tell what from this much info.  You might
> > try making a one-liner program that just calls gethostbyname, and
> > work on debugging that simpler situation.
> > 
> >             regards, tom lane
> > 
> 
> 
> ************


pgsql-interfaces by date:

Previous
From: sieberg@cadvision.com (Ross Sieber)
Date:
Subject: Re: DBD for Postgreslq 4.5.1 (libpq.so.2)
Next
From: Tom Lane
Date:
Subject: Re: [INTERFACES] Win32 interface