i'v created a patch enables support for building PostgreSQL with Visual
Studio 2010 or Microsoft Windows SDK for Windows 7 and .NET Framework 4
(Windows SDK 7.1).
You can grab it from http://www.piening.info/VS2010.patch
It only touches the .pl, .pm and .bat files in src/tools/msvc so it's
relevant for Windows only (that's why i've left crlf line endings - is
that actually ok or should I have converted them?).
It's diffed against current head + running "perltidy -b -bl -nsfs -naws
-l=100 -ole=unix *.pl *.pm" as described in the README file (which seems
not to have been run before committing Mkvcbuild.pm the last time).
It is problably neither the perfect way to introduce VS2010 support (my
perl is better than my C but probably still not what you are used to)
nor is it my way to try to make you officially support VS 2010. But
perhaps it's something you could start with once you decide to upgrade
the msvc toolchain.
The patch is necessary because M$ got rid of vcbuild in favour of
msbuild which uses a different build file format (*.vcxproj).
It should support all use cases described in
and builds in Windows SDK 7.0 (VS 2008 toolchain) x86 and x64 as well as
Windows SDK 7.1 (VS 2010 toolchain) x86 and x64.
The SDK 7.1 build produces tons of warnings which are mostly macro
redefinitions of EIDRM, EMSGSIZE, EAFNOSUPPORT, EWOULDBLOCK, ECONNRESET,
EINPROGRESS, ENOBUFS, EPROTONOSUPPORT, ECONNREFUSED and EOPNOTSUPP which
seem to have found their way into errno.h finally. Cutting those out of
src\include\pg_config_os.h and src\interfaces\libpq\win32.h makes the
project build pretty clean.
I resisted the temptation to parse them out of those files during
Mkvcbuild::mkvcbuild as this should probably be handled by some
The build result passes vcregress check.
The pgsql.sln file also opens and builds in VS 2010.
I hope it is of some use.