pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Enable Unix-domain sockets support on Windows
Date: Sat, 28 Mar 2020 14:06:59 +0000
Message-ID: <E1jIC71-0000lT-0O@gemulon.postgresql.org> (raw)

Enable Unix-domain sockets support on Windows

As of Windows 10 version 1803, Unix-domain sockets are supported on
Windows.  But it's not automatically detected by configure because it
looks for struct sockaddr_un and Windows doesn't define that.  So we
just make our own definition on Windows and override the configure
result.

Set DEFAULT_PGSOCKET_DIR to empty on Windows so by default no
Unix-domain socket is used, because there is no good standard
location.

In pg_upgrade, we have to do some extra tweaking to preserve the
existing behavior of not using Unix-domain sockets on Windows.  Adding
support would be desirable, but it needs further work, in particular a
way to select whether to use Unix-domain sockets from the command-line
or with a run-time test.

The pg_upgrade test script needs a fix.  The previous code passed
"localhost" to postgres -k, which only happened to work because
Windows used to ignore the -k argument value altogether.  We instead
need to pass an empty string to get the desired effect.

The test suites will continue to not use Unix-domain sockets on
Windows.  This requires a small tweak in pg_regress.c.  The TAP tests
don't need to be changed because they decide by the operating system
rather than HAVE_UNIX_SOCKETS.

Reviewed-by: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Discussion: https://www.postgresql.org/message-id/flat/54bde68c-d134-4eb8-5bd3-8af33b72a010@2ndquadrant.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/8f3ec75de4060d86176ad4ac998eeb87a39748c2

Modified Files
--------------
config/c-library.m4            |  5 +++--
configure                      |  5 ++++-
src/bin/pg_upgrade/option.c    |  4 ++--
src/bin/pg_upgrade/server.c    |  2 +-
src/bin/pg_upgrade/test.sh     | 11 ++++++-----
src/include/c.h                |  4 ++++
src/include/pg_config.h.in     |  6 +++---
src/include/pg_config_manual.h | 15 ++++++++-------
src/include/port/win32.h       | 11 +++++++++++
src/test/regress/pg_regress.c  | 10 +++++++---
src/tools/msvc/Solution.pm     |  2 +-
11 files changed, 50 insertions(+), 25 deletions(-)



view thread (9+ messages)  latest in thread

Message-ID: <E1jIC71-0000lT-0O@gemulon.postgresql.org>
Permalink:  ../E1jIC71-0000lT-0O@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1jIC71-0000lT-0O@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: peter@eisentraut.org
  Subject: Re: pgsql: Enable Unix-domain sockets support on Windows
  In-Reply-To: <E1jIC71-0000lT-0O@gemulon.postgresql.org>
  References: <E1jIC71-0000lT-0O@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox