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

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