It works!
(apparently as of Windows 10 version 1803)
Here are some patches to get a discussion rolling.
Basically, it just works, but you need to define your own struct
sockaddr_un. (This is what configure currently uses as a proxy for
HAVE_UNIX_SOCKETS, so (a) that needs a bit of tweaking, and (b) that is
the reason why builds haven't blown up already.)
But we'll now need to make things work so that binaries with Unix-domain
socket support work on systems without run-time support. We already did
that exercise with IPv6 support, so some of the framework is already in
place.
Depending on your Windows environment, there might not be a suitable
/tmp directory, so you'll need to specify a directory explicitly using
postgres -k or similar. This leads to the question what the default for
DEFAULT_PGSOCKET_DIR should be on Windows. I think it's probably best,
at least for now, to set it so that by default, neither server nor libpq
use Unix sockets unless explicitly selected. This can be done easily on
the server side by defining DEFAULT_PGSOCKET_DIR as "". But in libpq, I
don't think the code would handle that correctly everywhere, so it would
need some more analysis and restructuring possibly.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services