diff -urpa postgresql-9.4.19.orig/src/bin/pg_config/pg_config.c postgresql-9.4.19/src/bin/pg_config/pg_config.c --- postgresql-9.4.19.orig/src/bin/pg_config/pg_config.c 2018-08-23 18:44:23.120449907 +0000 +++ postgresql-9.4.19/src/bin/pg_config/pg_config.c 2018-08-23 18:44:31.757449810 +0000 @@ -26,6 +26,8 @@ #include "port.h" +#include "../port/pg_config_paths.h" + static const char *progname; static char mypath[MAXPGPATH]; @@ -481,7 +483,6 @@ main(int argc, char **argv) { int i; int j; - int ret; set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("pg_config")); @@ -497,13 +498,7 @@ main(int argc, char **argv) } } - ret = find_my_exec(argv[0], mypath); - - if (ret) - { - fprintf(stderr, _("%s: could not find own program executable\n"), progname); - exit(1); - } + snprintf(mypath, sizeof(mypath), "%s/%s", PGBINDIR, progname); /* no arguments -> print everything */ if (argc < 2) diff -urpa postgresql-9.4.19.orig/src/Makefile.global.in postgresql-9.4.19/src/Makefile.global.in --- postgresql-9.4.19.orig/src/Makefile.global.in 2018-08-23 18:44:23.002449908 +0000 +++ postgresql-9.4.19/src/Makefile.global.in 2018-08-23 18:44:31.757449810 +0000 @@ -119,7 +119,7 @@ libdir := @libdir@ pkglibdir = $(libdir) ifeq "$(findstring pgsql, $(pkglibdir))" "" ifeq "$(findstring postgres, $(pkglibdir))" "" -override pkglibdir := $(pkglibdir)/postgresql +override pkglibdir := $(pkglibdir)/postgresql/@PG_MAJORVERSION@/lib endif endif @@ -167,7 +167,7 @@ endif # PGXS # These derived path variables aren't separately configurable. -includedir_server = $(pkgincludedir)/server +includedir_server = $(pkgincludedir)/@PG_MAJORVERSION@/server includedir_internal = $(pkgincludedir)/internal pgxsdir = $(pkglibdir)/pgxs