Blame SOURCES/postgresql-socket-dirs-pgupgrade.patch

62d2ae
Expect unix_socket_directories on RHEL's PostgreSQL 9.2
62d2ae
62d2ae
If REDHAT_PGUPGRADE_FROM_RHEL is defined, (Red Hat only versions of) pg_upgrade
62d2ae
are told to run the older server than 9.2 with unix_socket_directories instead
62d2ae
of unix_socket_directory.  By default, even 9.2 is called with
62d2ae
unix_socket_directory which breaks upgrade from RHSCL 9.2.
62d2ae
62d2ae
diff --git a/src/bin/pg_upgrade/server.c b/src/bin/pg_upgrade/server.c
62d2ae
index 3d041ef..a9c56e0 100644
62d2ae
--- a/src/bin/pg_upgrade/server.c
62d2ae
+++ b/src/bin/pg_upgrade/server.c
62d2ae
@@ -191,6 +191,12 @@ start_postmaster(ClusterInfo *cluster, bool throw_error)
62d2ae
 
62d2ae
 	static bool exit_hook_registered = false;
62d2ae
 
62d2ae
+	/* By default set to what upstream uses */
62d2ae
+	int			rh_sock_dir_split = 903;
62d2ae
+	if (getenv("REDHAT_PGUPGRADE_FROM_RHEL")) {
62d2ae
+		rh_sock_dir_split = 902;
62d2ae
+	}
62d2ae
+
62d2ae
 	if (!exit_hook_registered)
62d2ae
 	{
62d2ae
 		atexit(stop_postmaster_atexit);
62d2ae
@@ -227,7 +227,7 @@
62d2ae
 		snprintf(socket_string + strlen(socket_string),
62d2ae
 				 sizeof(socket_string) - strlen(socket_string),
62d2ae
 				 " -c %s='%s'",
62d2ae
-				 (GET_MAJOR_VERSION(cluster->major_version) <= 902) ?
62d2ae
+				 (GET_MAJOR_VERSION(cluster->major_version) < rh_sock_dir_split) ?
62d2ae
 				 "unix_socket_directory" : "unix_socket_directories",
62d2ae
 				 cluster->sockdir);
62d2ae
 #endif