]> TLD Linux GIT Repositories - packages/postgresql.git/blob - socket-dir-fixes.patch
- updated to 12.3
[packages/postgresql.git] / socket-dir-fixes.patch
1 diff -urpa postgresql-10.5.orig/src/bin/pg_upgrade/option.c postgresql-10.5/src/bin/pg_upgrade/option.c
2 --- postgresql-10.5.orig/src/bin/pg_upgrade/option.c    2018-08-22 19:57:55.237373015 +0000
3 +++ postgresql-10.5/src/bin/pg_upgrade/option.c 2018-08-22 19:59:10.944372163 +0000
4 @@ -474,8 +474,14 @@
5          */
6         if (GET_MAJOR_VERSION(cluster->major_version) >= 901)
7         {
8 -               if (!live_check)
9 +               if (!live_check) {
10                         cluster->sockdir = user_opts.socketdir;
11 +#ifndef UNIX_PATH_MAX
12 +#define UNIX_PATH_MAX 108
13 +#endif
14 +                       if (strlen(cluster->sockdir) >= UNIX_PATH_MAX - sizeof(".s.PGSQL.50432"))
15 +                               strcpy(cluster->sockdir, "/tmp"); /* fall back to tmp */
16 +               }
17                 else
18                 {
19                         /*
20 diff -urpa postgresql-10.5.orig/src/include/pg_config_manual.h postgresql-10.5/src/include/pg_config_manual.h
21 --- postgresql-10.5.orig/src/include/pg_config_manual.h 2018-08-22 19:57:55.095373017 +0000
22 +++ postgresql-10.5/src/include/pg_config_manual.h      2018-08-22 19:58:30.664372616 +0000
23 @@ -181,7 +181,7 @@
24   * here's where to twiddle it.  You can also override this at runtime
25   * with the postmaster's -k switch.
26   */
27 -#define DEFAULT_PGSOCKET_DIR  "/tmp"
28 +#define DEFAULT_PGSOCKET_DIR  "/var/run/postgresql"
29  
30  /*
31   * This is the default event source for Windows event log.