v6-0002-pg_upgrade-Disable-Unix-domain-socket-support-on-.patch
text/plain
Filename: v6-0002-pg_upgrade-Disable-Unix-domain-socket-support-on-.patch
Type: text/plain
Part: 1
Patch
Format: format-patch
Series: patch v6-0002
Subject: pg_upgrade: Disable Unix-domain socket support on Windows
| File | + | − |
|---|---|---|
| src/bin/pg_upgrade/option.c | 2 | 2 |
| src/bin/pg_upgrade/server.c | 1 | 1 |
From 75f193e8aa6e5693517078516239503e17c515a2 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter@eisentraut.org>
Date: Tue, 11 Feb 2020 23:53:56 +0100
Subject: [PATCH v6 2/5] pg_upgrade: Disable Unix-domain socket support on
Windows
This preserves the existing behavior of not using Unix-domain sockets
on Windows in pg_upgrade. 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.
---
src/bin/pg_upgrade/option.c | 4 ++--
src/bin/pg_upgrade/server.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/bin/pg_upgrade/option.c b/src/bin/pg_upgrade/option.c
index eed70fff4f..7b957ee365 100644
--- a/src/bin/pg_upgrade/option.c
+++ b/src/bin/pg_upgrade/option.c
@@ -467,7 +467,7 @@ adjust_data_dir(ClusterInfo *cluster)
void
get_sock_dir(ClusterInfo *cluster, bool live_check)
{
-#ifdef HAVE_UNIX_SOCKETS
+#if defined(HAVE_UNIX_SOCKETS) && !defined(WIN32)
/*
* sockdir and port were added to postmaster.pid in PG 9.1. Pre-9.1 cannot
@@ -529,7 +529,7 @@ get_sock_dir(ClusterInfo *cluster, bool live_check)
* default
*/
cluster->sockdir = NULL;
-#else /* !HAVE_UNIX_SOCKETS */
+#else /* !HAVE_UNIX_SOCKETS || WIN32 */
cluster->sockdir = NULL;
#endif
}
diff --git a/src/bin/pg_upgrade/server.c b/src/bin/pg_upgrade/server.c
index e244256501..f8d57663e5 100644
--- a/src/bin/pg_upgrade/server.c
+++ b/src/bin/pg_upgrade/server.c
@@ -210,7 +210,7 @@ start_postmaster(ClusterInfo *cluster, bool report_and_exit_on_error)
socket_string[0] = '\0';
-#ifdef HAVE_UNIX_SOCKETS
+#if defined(HAVE_UNIX_SOCKETS) && !defined(WIN32)
/* prevent TCP/IP connections, restrict socket access */
strcat(socket_string,
" -c listen_addresses='' -c unix_socket_permissions=0700");
--
2.25.0