Blame SOURCES/libecpg-10.5-var-run-socket.patch

4faa0f
Change the built-in default socket directory to be /var/run/postgresql.
4faa0f
For backwards compatibility with (probably non-libpq-based) clients that
4faa0f
might still expect to find the socket in /tmp, also create a socket in
4faa0f
/tmp.  This is to resolve communication problems with clients operating
4faa0f
under systemd's PrivateTmp environment, which won't be using the same
4faa0f
global /tmp directory as the server; see bug #825448.
4faa0f
4faa0f
Note that we apply the socket directory change at the level of the
4faa0f
hard-wired defaults in the C code, not by just twiddling the setting in
4faa0f
postgresql.conf.sample; this is so that the change will take effect on
4faa0f
server package update, without requiring any existing postgresql.conf
4faa0f
to be updated.  (Of course, a user who dislikes this behavior can still
4faa0f
override it via postgresql.conf.)
4faa0f
4faa0f
diff -up postgresql-13.0/src/include/pg_config_manual.h.patch1 postgresql-13.0/src/include/pg_config_manual.h
4faa0f
--- postgresql-13.0/src/include/pg_config_manual.h.patch1	2020-10-23 10:18:12.204959024 +0200
4faa0f
+++ postgresql-13.0/src/include/pg_config_manual.h	2020-10-23 10:18:39.391208931 +0200
4faa0f
@@ -201,7 +201,7 @@
4faa0f
  * support them yet.
4faa0f
  */
4faa0f
 #ifndef WIN32
4faa0f
-#define DEFAULT_PGSOCKET_DIR  "/tmp"
4faa0f
+#define DEFAULT_PGSOCKET_DIR  "/var/run/postgresql"
4faa0f
 #else
4faa0f
 #define DEFAULT_PGSOCKET_DIR ""
4faa0f
 #endif