--- postgresql-9.2.4/src/interfaces/libpq/fe-connect.c.orig 2013-08-15 09:08:59.850609595 -0500 +++ postgresql-9.2.4/src/interfaces/libpq/fe-connect.c 2013-08-15 09:42:59.001463906 -0500 @@ -1778,10 +1778,16 @@ if (connect(conn->sock, addr_cur->ai_addr, addr_cur->ai_addrlen) < 0) { +#ifndef WIN32 if (SOCK_ERRNO == EINPROGRESS || SOCK_ERRNO == EWOULDBLOCK || SOCK_ERRNO == EINTR || +#else + if (SOCK_ERRNO == WSAEINPROGRESS || + SOCK_ERRNO == WSAEWOULDBLOCK || + SOCK_ERRNO == WSAEINTR || SOCK_ERRNO == 0) +#endif { /* * This is fine - we're in non-blocking mode, and