RE: Re: Can't connect using Win95 client

"Pinchart, Laurent" <[email protected]> Fri, 13 Jun 2003 09:57:46 +0200
Newsgroups gmane.comp.python.db.pypgsql.user
Message-ID <[email protected]>
> > [Win95 and host name resolution]
> > I experienced the same problem today in Windows 2000.
> 
>  From what I see, this is a totally different problem.

You're probably right.

> >>>>PgSQL.connect(host="localhost", database="Test")
> > 
> > Traceback (most recent call last):
> >   File "<stdin>", line 1, in ?
> >   File 
> "D:\Soft\Python22\lib\site-packages\pyPgSQL\PgSQL.py", line 2118, in
> > connect
> >     return Connection(connInfo, client_encoding, unicode_results)
> >   File 
> "D:\Soft\Python22\lib\site-packages\pyPgSQL\PgSQL.py", line 2215, in
> > __init__
> >     raise DatabaseError, m
> > libpq.DatabaseError: unknown host name: localhost
> 
> That's very strange. Have you compiled pyPgSQL yourself from sources? 
> Have you linked it dynamically against libpq? The binaries I 
> offer on SF are built *statically* against libpq and do not suffer from 
> this problem.

Yes I did (to fix a problem for which I submitted a patch). That's probably
the cause of the problem, as I don't remember having encountered it before.

I compiled libpq using Visual Studio 6 (nmake -f win32.mak), and then
compiled pyPgSQL using the same compiler (python setup.py build).

There must be something wrong though, because the version of libpq.pyd that
I compiled myself seems to use the GUI subsystem, while the one in the
binary package uses Console. There are a few more differences (linker
version for instance, 6.0 for me, 2.56 for you).

There's also a difference regarding to wsock32.dll. My version of libpq.pyd
imports wsock32.dll using ordinal imports, while yours directly reference
the functions. My version doesn't reference WSAStartup while yours does.

Is there something I did wrong ? I modified setup.py according to the
instructions inside the file for Visual Studio (setup.py uses mingw by
defaults).

> Which PostgreSQL version do you link against?

7.3.2.

Laurent Pinchart


-------------------------------------------------------
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5