We have code paths for Unix socket support and no Unix socket support. Now add a third variant: Unix socket support but do not use a Unix socket by default in the client or the server, only if you explicitly specify one. This will be useful when we enable Unix socket support on Windows.
To implement this, tweak things so that setting DEFAULT_PGSOCKET_DIR to "" has the desired effect. This mostly already worked like that; only a few places needed to be adjusted. Notably, the reference to DEFAULT_PGSOCKET_DIR in UNIXSOCK_PATH() could be removed because all callers already resolve an empty socket directory setting with a default if appropriate.
a9cff89f7e Allow building without default socket directory
src/include/libpq/pqcomm.h | 6 +++---
src/include/pg_config_manual.h | 5 +++++
src/interfaces/libpq/fe-connect.c | 15 ++++++++++-----
3 files changed, 18 insertions(+), 8 deletions(-)