1 diff -urpa postgresql-13.1.orig/src/bin/pg_upgrade/option.c postgresql-13.1/src/bin/pg_upgrade/option.c
2 --- postgresql-13.1.orig/src/bin/pg_upgrade/option.c 2020-11-09 23:24:30.000000000 +0100
3 +++ postgresql-13.1/src/bin/pg_upgrade/option.c 2020-12-03 20:58:30.431778786 +0100
4 @@ -476,8 +476,14 @@ get_sock_dir(ClusterInfo *cluster, bool
6 if (GET_MAJOR_VERSION(cluster->major_version) >= 901)
10 cluster->sockdir = user_opts.socketdir;
11 +#ifndef UNIX_PATH_MAX
12 +#define UNIX_PATH_MAX 108
14 + if (strlen(cluster->sockdir) >= UNIX_PATH_MAX - sizeof(".s.PGSQL.50432"))
15 + strcpy(cluster->sockdir, "/tmp"); /* fall back to tmp */
20 diff -urpa postgresql-13.1.orig/src/include/pg_config_manual.h postgresql-13.1/src/include/pg_config_manual.h
21 --- postgresql-13.1.orig/src/include/pg_config_manual.h 2020-11-09 23:24:30.000000000 +0100
22 +++ postgresql-13.1/src/include/pg_config_manual.h 2020-12-03 20:59:32.262778786 +0100
27 -#define DEFAULT_PGSOCKET_DIR "/tmp"
28 +#define DEFAULT_PGSOCKET_DIR "/var/run/postgresql"
30 #define DEFAULT_PGSOCKET_DIR ""