pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff Johnson <jeff@jeffjohnson.net>
To: 'Bruce Momjian' <pgman@candle.pha.pa.us>
To: jeff@jeffjohnson.net
Cc: pgsql-interfaces@postgresql.org
Cc: pgsql-docs@postgresql.org
Subject: RE: [INTERFACES] libpq sockets on win32
Date: Mon, 4 Jun 2001 16:25:05 -0400
Message-ID: <B9C9130B5D27D4119D5D00A0C9D3A987109461@SERVER> (raw)
In-Reply-To: <B9C9130B5D27D4119D5D00A0C9D3A98719318C@SERVER>

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
>




view thread (16+ messages)  latest in thread

Message-ID: <B9C9130B5D27D4119D5D00A0C9D3A987109461@SERVER>
Permalink:  ../B9C9130B5D27D4119D5D00A0C9D3A987109461@SERVER/
Also on:    postgresql.org/message-id/B9C9130B5D27D4119D5D00A0C9D3A987109461@SERVER

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: jeff@jeffjohnson.net, pgman@candle.pha.pa.us, pgsql-docs@postgresql.org
  Subject: RE: [INTERFACES] libpq sockets on win32
  In-Reply-To: <B9C9130B5D27D4119D5D00A0C9D3A987109461@SERVER>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox