Re: [HACKERS] Fix Windows socket error checking for MinGW

2013-08-22 Thread Michael Cronenworth
On 08/21/2013 10:06 PM, Noah Misch wrote: I concur, but our field experience doing it this way lessens my concern. I see this change has hit master. I've pulled in the new patch for the Fedora MinGW package. Thanks, Michael -- Sent via pgsql-hackers mailing list

Re: [HACKERS] Fix Windows socket error checking for MinGW

2013-08-21 Thread Noah Misch
On Mon, Aug 19, 2013 at 08:46:11AM -0500, Michael Cronenworth wrote: On 08/17/2013 12:16 AM, Noah Misch wrote: 1. Redefine those constants for more (all?) compilers. 2. Remove that block and put #ifdef around all usage of such constants in frontend code, as you have done. 3. Remove that

Re: [HACKERS] Fix Windows socket error checking for MinGW

2013-08-20 Thread Andrew Dunstan
On 08/19/2013 11:36 PM, Michael Cronenworth wrote: On 08/19/2013 07:35 PM, Noah Misch wrote: That was option #1. (You weren't planning to change just the one symbol causing the failure at hand, were you?) Reasonable choice. The point in the code comment quoted above looks bad, but the lack

Re: [HACKERS] Fix Windows socket error checking for MinGW

2013-08-19 Thread Michael Cronenworth
On 08/17/2013 12:16 AM, Noah Misch wrote: 1. Redefine those constants for more (all?) compilers. 2. Remove that block and put #ifdef around all usage of such constants in frontend code, as you have done. 3. Remove that block and make src/backend/port/win32/socket.c frontend-usable, so

Re: [HACKERS] Fix Windows socket error checking for MinGW

2013-08-19 Thread Michael Cronenworth
On 08/18/2013 12:02 PM, Andrew Dunstan wrote: There is a much simpler fix, which is to do these assignments unconditionally in src/port/win32.h. The following small change fixes the problem for me: No. Please do not do this. Note that the original patch appears to be not only misguided

Re: [HACKERS] Fix Windows socket error checking for MinGW

2013-08-19 Thread Michael Cronenworth
On 08/17/2013 02:33 PM, Noah Misch wrote: One of the reports Michael cited was apparently native: http://www.postgresql.org/message-id/e1uclpd-l4...@wrigleys.postgresql.org Perhaps only some versions of w32api trigger the problem. I agree we ought to understand the necessary conditions

Re: [HACKERS] Fix Windows socket error checking for MinGW

2013-08-19 Thread Andrew Dunstan
On 08/19/2013 09:50 AM, Michael Cronenworth wrote: On 08/18/2013 12:02 PM, Andrew Dunstan wrote: There is a much simpler fix, which is to do these assignments unconditionally in src/port/win32.h. The following small change fixes the problem for me: No. Please do not do this. If you object

Re: [HACKERS] Fix Windows socket error checking for MinGW

2013-08-19 Thread Michael Cronenworth
On 08/19/2013 09:11 AM, Andrew Dunstan wrote: I already gave you a sufficient identifier for the commit. In case you're not aware, git is quite happy dealing with small commit identifiers. If you do git log -1 a099482 you should get the details you require. It should cross your mind that

Re: [HACKERS] Fix Windows socket error checking for MinGW

2013-08-19 Thread Robert Haas
On Mon, Aug 19, 2013 at 10:18 AM, Michael Cronenworth m...@cchtml.com wrote: On 08/19/2013 09:11 AM, Andrew Dunstan wrote: I already gave you a sufficient identifier for the commit. In case you're not aware, git is quite happy dealing with small commit identifiers. If you do git log -1

Re: [HACKERS] Fix Windows socket error checking for MinGW

2013-08-19 Thread Alvaro Herrera
Michael Cronenworth wrote: On 08/17/2013 12:16 AM, Noah Misch wrote: 1. Redefine those constants for more (all?) compilers. 2. Remove that block and put #ifdef around all usage of such constants in frontend code, as you have done. 3. Remove that block and make

Re: [HACKERS] Fix Windows socket error checking for MinGW

2013-08-19 Thread Andrew Dunstan
On 08/19/2013 10:35 AM, Robert Haas wrote: TBH, I think Andrew is going above and beyond the call of duty by developing and testing a patch for the problem you reported. I've actually known about this problem for a while, but mistakenly thought it only occurred for cross-compilation:

Re: [HACKERS] Fix Windows socket error checking for MinGW

2013-08-19 Thread Noah Misch
On Sun, Aug 18, 2013 at 01:02:57PM -0400, Andrew Dunstan wrote: On 08/17/2013 01:16 AM, Noah Misch wrote: /* * For Microsoft Visual Studio 2010 and above we intentionally redefine * the regular Berkeley error constants and set them to the WSA constants. * Note that this will break if

Re: [HACKERS] Fix Windows socket error checking for MinGW

2013-08-19 Thread Michael Cronenworth
On 08/19/2013 07:35 PM, Noah Misch wrote: That was option #1. (You weren't planning to change just the one symbol causing the failure at hand, were you?) Reasonable choice. The point in the code comment quoted above looks bad, but the lack of reports of that nature against official 9.2

Re: [HACKERS] Fix Windows socket error checking for MinGW

2013-08-18 Thread Andrew Dunstan
On 08/17/2013 01:16 AM, Noah Misch wrote: On Fri, Aug 16, 2013 at 06:56:45PM -0500, Michael Cronenworth wrote: I started a thread on the general list so read that for more info. http://www.postgresql.org/message-id/520a6e55.40...@cchtml.com I'm also going to submit the patch to CommitFest.

Re: [HACKERS] Fix Windows socket error checking for MinGW

2013-08-17 Thread Andrew Dunstan
On 08/17/2013 01:16 AM, Noah Misch wrote: On Fri, Aug 16, 2013 at 06:56:45PM -0500, Michael Cronenworth wrote: I started a thread on the general list so read that for more info. http://www.postgresql.org/message-id/520a6e55.40...@cchtml.com I'm also going to submit the patch to CommitFest.

Re: [HACKERS] Fix Windows socket error checking for MinGW

2013-08-17 Thread Noah Misch
On Sat, Aug 17, 2013 at 02:04:24PM -0400, Andrew Dunstan wrote: On Fri, Aug 16, 2013 at 06:56:45PM -0500, Michael Cronenworth wrote: +#ifndef WIN32 if (SOCK_ERRNO == EWOULDBLOCK) +#else + if (SOCK_ERRNO == WSAEWOULDBLOCK) +#endif We don't seem to have a problem with

[HACKERS] Fix Windows socket error checking for MinGW

2013-08-16 Thread Michael Cronenworth
I started a thread on the general list so read that for more info. http://www.postgresql.org/message-id/520a6e55.40...@cchtml.com I'm also going to submit the patch to CommitFest. Thanks, Michael From bb79da0013d5169b4530df28ece0c296004d1db4 Mon Sep 17 00:00:00 2001 From: Michael Cronenworth

Re: [HACKERS] Fix Windows socket error checking for MinGW

2013-08-16 Thread Noah Misch
On Fri, Aug 16, 2013 at 06:56:45PM -0500, Michael Cronenworth wrote: I started a thread on the general list so read that for more info. http://www.postgresql.org/message-id/520a6e55.40...@cchtml.com I'm also going to submit the patch to CommitFest. +#ifndef WIN32 if