From: Pinchart, L. <Pin...@PC...> - 2003-06-13 08:00:57
|
> > [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 |