Re: Unix-domain socket support on Windows
Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2020-02-12T08:32:33Z
Lists: pgsql-hackers
Attachments
- v6-0001-Enable-Unix-domain-sockets-support-on-Windows.patch (text/plain) patch v6-0001
- v6-0002-pg_upgrade-Disable-Unix-domain-socket-support-on-.patch (text/plain) patch v6-0002
- v6-0003-initdb-Detect-Unix-domain-socket-support-dynamica.patch (text/plain) patch v6-0003
- v6-0004-Fix-pg_upgrade-test-for-Unix-domain-sockets-on-Wi.patch (text/plain) patch v6-0004
- v6-0005-Allow-using-Unix-domain-sockets-on-Windows-in-tes.patch (text/plain) patch v6-0005
Here is another patch set to enable this functionality. 0001 enables Unix-domain sockets on Windows, but leaves them turned off by default at run time, using the mechanism introduced by a9cff89f7e. This is relatively straightforward, except perhaps some aesthetic questions about how these different configuration bits are distributed around the various files. 0002 deals with pg_upgrade. It preserves the existing behavior of not using Unix-domain sockets on Windows. This could perhaps be enhanced later by either adding a command-line option or a run-time test. It's too complicated right now. 0003 deals with how initdb should initialize postgresql.conf and pg_hba.conf. It introduces a run-time test similar to how we detect presence of IPv6. After I wrote this patch, I have come to think that this is overkill and we should just always leave the "local" line in pg_hba.conf even if there is no run-time support in the OS. (I think the reason we do the run-time test for IPv6 is that we need it to parse the IPv6 addresses in pg_hba.conf, but there is no analogous requirement for Unix-domain sockets.) This patch is optional in any case. 0004 fixes a bug in the pg_upgrade test.sh script that was exposed by these changes. 0005 fixes up some issues in the test suites. Right now, the TAP tests are hardcoded to not use Unix-domain sockets on Windows, where as pg_regress keys off HAVE_UNIX_SOCKETS, which is no longer a useful distinguisher. The change is to not use Unix-domain sockets for all the tests by default on Windows (the previous behavior) but give an option to use them. At the moment, I would consider running the test suites with Unix-domain sockets enabled as experimental, but that's only because of various issues in the test setups. For instance, there is an issue in the comment of pg_regress.c remove_temp() that I'm not sure how to address. Also, the TAP tests don't seem to work because of some path issues. I figured I'd call time on fiddling with this for now and ship the patches. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Commits
-
Allow using Unix-domain sockets on Windows in tests
- 1d53432ff940 13.0 landed
-
pg_regress: Observe TMPDIR
- 9cedb1666051 13.0 landed
-
Enable Unix-domain sockets support on Windows
- 8f3ec75de406 13.0 landed
-
psql: Remove one use of HAVE_UNIX_SOCKETS
- 541757f34ee0 13.0 landed
-
Allow building without default socket directory
- a9cff89f7e63 13.0 landed
-
Sort out getpeereid() and peer auth handling on Windows
- f14413b684d5 13.0 landed