Last July, PostgreSQL moved from minimum version 2.5.4a. of flex to 2.5.31, so that we could use re-entrant scanners. The problem with this was that the newer version of flex runs everything in a chain of filters, which it sets up by forking. That's a problem on WIndows, so the latest version of flex supported by the GnuWin32 people is still 2.5.4a. So I created a build of flex version 2.5.35 using Cygwin, and put it together with the Cygwin DLL used to build it, on our download sites.
However, it turned out last December that this didn't work on 64 bit Windows. I spent some hours wrestling with the problem, without great success, and then got diverted onto other things. Yesterday I returned to the problem. Part of my difficulty is that I don't have a 64 bit Windows environment to test with. Enter GoGrid. With a few clicks I was able to set up an instance of Windows Server 2008 64 bit. After some experimentation, I found that using a more modern version of the Cygwin DLL, the existing flex I created last July would work on 64 bit Windows.
This was complicated by the fact that Cygwin doesn't seem to install nicely on at least some virtualized Windows 64 bit installations, including those on both Amazon EC2 and GoGrid - something to do with Terminal Services and Data Execution Prevention, apparently. So I got around that by not installing at all. I downloaded the package containing the DLL from a Cygwin mirror site, extracted the DLL and put it in the directory along with the flex.exe, installed GnuWin32's m4, set up the M4 environment variable appropriately, and it all worked nicely.
A revised winflex has been uploaded to the PostgreSQL download site and should appear on mirrors soon.
This is a good example of how the cloud can work. Setting up a Windows 64 bit environment would have been quite difficult and time consuming for me, but for the cost of about half a latte, I was able to get one within minutes and verify this fix within hours. And I'm glad to have it fixed, because most of the alternatives to having a working flex were fairly unpalatable.
What is the preferred set of versions to build postgres?<br />
I'm trying with the following setup and failing miserably:<br />
Windows 7 64bit<br />
Bison 2.4.1<br />
WinFlex from the postgres site 2.5.35<br />
Visual Studio 2008