Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.1) with SMTP id f5BCkrE56180 for ; Mon, 11 Jun 2001 08:46:53 -0400 (EDT) (envelope-from pgsql-docs-owner@postgresql.org) Received: from jeffjohnson.net (colo16.traci.net [216.242.235.49] (may be forged)) by postgresql.org (8.11.3/8.11.1) with ESMTP id f54KVJE12051; Mon, 4 Jun 2001 16:31:19 -0400 (EDT) (envelope-from jeff@jeffjohnson.net) Received: from ffsdev01 [64.135.29.202] by jeffjohnson.net with ESMTP (SMTPD32-6.05) id AFAC6330068; Mon, 04 Jun 2001 16:29:32 -0400 Reply-To: From: "Jeff Johnson" To: "'Bruce Momjian'" , Cc: , Subject: RE: [INTERFACES] libpq sockets on win32 Date: Mon, 4 Jun 2001 16:25:05 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2910.0) In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Importance: Normal X-Archive-Number: 200106/20 X-Sequence-Number: 815 I found this in WinSock.h ... it might shed some light on the problem. #define WSABASEERR 10000 [snip] /* * Windows Sockets definitions of regular Berkeley error constants */ #define WSAEWOULDBLOCK (WSABASEERR+35) #define WSAEINPROGRESS (WSABASEERR+36) > -----Original Message----- > From: Bruce Momjian [mailto:pgman@candle.pha.pa.us] > Sent: Monday, June 04, 2001 4:02 PM > To: jeff@jeffjohnson.net > Cc: pgsql-interfaces@postgresql.org; pgsql-docs@postgresql.org > Subject: Re: [INTERFACES] libpq sockets on win32 > > > > > I have done exactly that. I assume fcntl(), ioctl(), > > > select() use errno > > > even if used on a socket, while getsockopt(), setsockopt(), > > socket(), > > > connect(), getsockname(), send(), recv() use WSAGetLastError. Is > > this > > > list correct? > > > > I don't know enough about such things. > > The web page wasn't clear about that. > > > > > > > The patch is attached. Please let me know so I can > finalize it and > > > apply it. > > > > Couple of changes required to compile on Win32: > > > > Change: > > #define sockerrno WSAGetLastError > > To: > > #define sockerrno WSAGetLastError() > > > > OK. > > > > > This has to go back into fe-connect.c, EINPROGRESS isn't defined in > > Win32 for some reason.. > > #ifndef WIN32 > > if (errno == EINPROGRESS || errno == 0) > > #else > > if (WSAGetLastError() == WSAEINPROGRESS) > > #endif > > > > OK. Not sure why it wasn't defined, but, oh well. > > > > > > > I tested it out but I'm getting this error when sending a large SQL > > statement (>16k). > > cu.execute(sql) > > File "c:\python20\pgdb.py", line 189, in execute > > self.executemany(operation, (params,)) > > File "c:\python20\pgdb.py", line 204, in executemany > > rows = self.__source.execute(sql) > > ValueError: pqReadData() -- read() failed: errno=10035 > > Unknown error > > That errno is very high, 10035. If I take a look at my sys/errno.h on > BSD/OS, I see: > > #define EAGAIN 35 /* Resource temporarily > unavailable */ > > so my guess is that WSAGetLastError() returns errno plus 10,000. What > value does your include file set for EAGAIN, 10035 or 35. If > it is 35, > the following patch may work. It has all your suggested fixes. > > -- > Bruce Momjian | http://candle.pha.pa.us > pgman@candle.pha.pa.us | (610) 853-3000 > + If your life is a hard drive, | 830 Blythe Avenue > + Christ can be your backup. | Drexel Hill, > Pennsylvania 19026 >