summaryrefslogtreecommitdiffstats
path: root/postgresql-socket-dirs-pgupgrade.patch
diff options
context:
space:
mode:
authorPavel Kajaba <pkajaba@redhat.com>2015-11-18 10:02:17 +0100
committerPavel Kajaba <pkajaba@redhat.com>2015-11-18 10:02:17 +0100
commitf51c859081bdb81b89293fa7a4d52782ce8429cb (patch)
treee0941f50fe65bcbe241150915e584e868e9a8ae0 /postgresql-socket-dirs-pgupgrade.patch
downloadpostgresql-f51c859081bdb81b89293fa7a4d52782ce8429cb.tar.gz
postgresql-f51c859081bdb81b89293fa7a4d52782ce8429cb.tar.xz
postgresql-f51c859081bdb81b89293fa7a4d52782ce8429cb.zip
Added initial files from branch rhscl-2.1-rh-postgresql94-rhel-7
Diffstat (limited to 'postgresql-socket-dirs-pgupgrade.patch')
-rw-r--r--postgresql-socket-dirs-pgupgrade.patch33
1 files changed, 33 insertions, 0 deletions
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