From f51c859081bdb81b89293fa7a4d52782ce8429cb Mon Sep 17 00:00:00 2001 From: Pavel Kajaba Date: Wed, 18 Nov 2015 10:02:17 +0100 Subject: Added initial files from branch rhscl-2.1-rh-postgresql94-rhel-7 --- postgresql-socket-dirs-pgupgrade.patch | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 postgresql-socket-dirs-pgupgrade.patch (limited to 'postgresql-socket-dirs-pgupgrade.patch') diff --git a/postgresql-socket-dirs-pgupgrade.patch b/postgresql-socket-dirs-pgupgrade.patch new file mode 100644 index 0000000..4bb3080 --- /dev/null +++ b/postgresql-socket-dirs-pgupgrade.patch @@ -0,0 +1,33 @@ +Expect unix_socket_directories on RHEL's PostgreSQL 9.2 + +If REDHAT_PGUPGRADE_FROM_RHEL is defined, (Red Hat only versions of) pg_upgrade +are told to run the older server than 9.2 with unix_socket_directories instead +of unix_socket_directory. By default, even 9.2 is called with +unix_socket_directory which breaks upgrade from RHSCL 9.2. + +diff --git a/contrib/pg_upgrade/server.c b/contrib/pg_upgrade/server.c +index 3d041ef..a9c56e0 100644 +--- a/contrib/pg_upgrade/server.c ++++ b/contrib/pg_upgrade/server.c +@@ -178,6 +178,12 @@ start_postmaster(ClusterInfo *cluster, bool throw_error) + bool pg_ctl_return = false; + char socket_string[MAXPGPATH + 200]; + ++ /* By default set to what upstream uses */ ++ int rh_sock_dir_split = 903; ++ if (getenv("REDHAT_PGUPGRADE_FROM_RHEL")) { ++ rh_sock_dir_split = 902; ++ } ++ + if (!exit_hook_registered) + { + atexit(stop_postmaster_atexit); +@@ -196,7 +202,7 @@ start_postmaster(ClusterInfo *cluster, bool throw_error) + snprintf(socket_string + strlen(socket_string), + sizeof(socket_string) - strlen(socket_string), + " -c %s='%s'", +- (GET_MAJOR_VERSION(cluster->major_version) < 903) ? ++ (GET_MAJOR_VERSION(cluster->major_version) < rh_sock_dir_split) ? + "unix_socket_directory" : "unix_socket_directories", + cluster->sockdir); + #endif -- cgit