Jason Erickson (jerickso(at)indian(dot)com) reports a bug with a severity of 3
The lower the number the more severe it is.
LIBPQ Linking with the static library on the WIN32 platform fails connections with "unknown host name".
I was having problems connecting up to a remote PostgreSQL database when I linked a program with the static library, receiving the error "unknown host name: 22.214.171.124". I was not experiencing this problem when I linked with the DLL.
Client: Microsoft Visual C++ 6.0, PostgreSQL 7.2.1
Server: FreeBSD 4.4-Stable, PosotgreSQL 7.2.1
I traced this down to the fact that with the static version of the library, the WinSock initialization functions are not being called (WSAStartup). The DLL calls the WinSock initialization function in the DllMain function.
I have included what I used to patch the file fe-connect.c in the example code section. This solution calls WSAStartup for every connection and WSACleanup for every closing call. I am not sure if I have all the exit paths. This patch might not be the best way to solve the problem, since the initialization function only needs to be called once, not for every connection.
> #if WIN32
> WSADATA wsaData;
> if (WSAStartup(MAKEWORD(1, 1), &wsaData))
> libpq_gettext("Unable to Initialize WSA\n"));
> goto connect_errReturn;
No file was uploaded with this report
pgsql-bugs by date
|Next:||From: pgsql-bugs||Date: 2002-04-23 02:02:15|
|Subject: Bug #642: Need "Alter table drop column"|
|Previous:||From: pgsql-bugs||Date: 2002-04-22 16:41:43|
|Subject: Bug #640: ECPG: inserting float numbers|