1 diff -urpa postgresql-9.6.10.orig/src/bin/pg_upgrade/option.c postgresql-9.6.10/src/bin/pg_upgrade/option.c
2 --- postgresql-9.6.10.orig/src/bin/pg_upgrade/option.c 2018-08-22 20:58:08.789332330 +0000
3 +++ postgresql-9.6.10/src/bin/pg_upgrade/option.c 2018-08-22 21:05:48.468327154 +0000
4 @@ -462,6 +462,11 @@ get_sock_dir(ClusterInfo *cluster, bool
5 cluster->sockdir = pg_malloc(MAXPGPATH);
6 if (!getcwd(cluster->sockdir, MAXPGPATH))
7 pg_fatal("cannot find current directory\n");
9 +#define UNIX_PATH_MAX 108
11 + if (strlen(cluster->sockdir) >= UNIX_PATH_MAX - sizeof(".s.PGSQL.50432"))
12 + strcpy(cluster->sockdir, "/tmp"); /* fall back to tmp */
16 @@ -487,7 +492,6 @@ get_sock_dir(ClusterInfo *cluster, bool
18 if (fgets(line, sizeof(line), fp) == NULL)
19 pg_fatal("Cannot read line %d from %s: %m\n", lineno, filename);
21 /* potentially overwrite user-supplied value */
22 if (lineno == LOCK_FILE_LINE_PORT)
23 sscanf(line, "%hu", &old_cluster.port);
24 diff -urpa postgresql-9.6.10.orig/src/include/pg_config_manual.h postgresql-9.6.10/src/include/pg_config_manual.h
25 --- postgresql-9.6.10.orig/src/include/pg_config_manual.h 2018-08-22 20:58:08.658332331 +0000
26 +++ postgresql-9.6.10/src/include/pg_config_manual.h 2018-08-22 20:58:43.807331936 +0000
28 * here's where to twiddle it. You can also override this at runtime
29 * with the postmaster's -k switch.
31 -#define DEFAULT_PGSOCKET_DIR "/tmp"
32 +#define DEFAULT_PGSOCKET_DIR "/var/run/postgresql"
35 * This is the default event source for Windows event log.