]> TLD Linux GIT Repositories - packages/postgresql.git/blob - socket-dir-fixes.patch
- moved data clusters to /var/lib/postgresql, misc fixes
[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 @@ -460,6 +460,11 @@ get_sock_dir(ClusterInfo *cluster, bool
5                         cluster->sockdir = pg_malloc(MAXPGPATH);
6                         if (!getcwd(cluster->sockdir, MAXPGPATH))
7                                 pg_fatal("could not determine current directory\n");
8 +#ifndef UNIX_PATH_MAX
9 +#define UNIX_PATH_MAX 108
10 +#endif
11 +                       if (strlen(cluster->sockdir) >= UNIX_PATH_MAX - sizeof(".s.PGSQL.50432"))
12 +                               strcpy(cluster->sockdir, "/tmp"); /* fall back to tmp */
13                 }
14                 else
15                 {
16 diff -urpa postgresql-10.5.orig/src/include/pg_config_manual.h postgresql-10.5/src/include/pg_config_manual.h
17 --- postgresql-10.5.orig/src/include/pg_config_manual.h 2018-08-22 19:57:55.095373017 +0000
18 +++ postgresql-10.5/src/include/pg_config_manual.h      2018-08-22 19:58:30.664372616 +0000
19 @@ -181,7 +181,7 @@
20   * here's where to twiddle it.  You can also override this at runtime
21   * with the postmaster's -k switch.
22   */
23 -#define DEFAULT_PGSOCKET_DIR  "/tmp"
24 +#define DEFAULT_PGSOCKET_DIR  "/var/run/postgresql"
25  
26  /*
27   * This is the default event source for Windows event log.