I'm having real trouble installing the extension pglogical on Mac.
Cloned the pglogical repo
When executing make install
I get the following error:
macuser$ make install
sed 's/__PGLOGICAL_VERSION__/2.4.1/;s/__REQUIRES__//'
/Users/macuser/temp/pglogical/pglogical.control.in >
/Users/macuser/temp/pglogical/pglogical.control
clang -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -
Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-
aliasing -fwrapv -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro
-O2 -I/usr/local/opt/postgresql@12/include -
I/Users/macuser/temp/pglogical/compat12 -Werror=implicit-function-declaration
-I. -I./ -I/usr/local/opt/postgresql@12/include/server -
I/usr/local/opt/postgresql@12/include/internal -I/usr/local/Cellar/icu4c/70.1/include
-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk
I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/readline/include -c -o
pglogical_apply.o pglogical_apply.c
pglogical_apply.c:13:10: fatal error: 'postgres.h' file not found
#include "postgres.h"
^~~~~~~~~~~~
1 error generated.
make: *** [pglogical_apply.o] Error 1
My concern is the directories that are shown in the error stack:
-I/usr/local/opt/postgresql@12/include/server
For my install the postgres.h file is actually located here:
/usr/local/opt/postgresql@12/include/postgresql/server
Same goes for the include
directory. Its missing the postgresql folder in this path.
I can hard code the location of the postgres.h file in the pglogical_apply.c, but that pushes me to the next 'missing directory' include error.
I ran this version of make install as detailed in the Postgres wiki with the same error.
https://wiki.postgresql.org/wiki/Building_and_Installing_PostgreSQL_Extension_Modules
I'm on Monteray 12.2.1 and have a single Pg12 installed.
How can I get make to reference the correct directory. ?
edit:
macuser$ make
PG_CONFIG=/usr/local/Cellar/postgresql@12/12.10_1/bin/pg_config
install
.......
pglogical_apply.c:13:10: fatal error: 'postgres.h' file not found
select * from pg_configure ;
BINDIR | /usr/local/Cellar/postgresql@12/12.10_1/bin
DOCDIR | /usr/local/Cellar/postgresql@12/12.10_1/share/doc/postgresql@12
HTMLDIR | /usr/local/Cellar/postgresql@12/12.10_1/share/doc/postgresql@12
INCLUDEDIR | /usr/local/opt/postgresql@12/include
PKGINCLUDEDIR | /usr/local/opt/postgresql@12/include
INCLUDEDIR-SERVER | /usr/local/opt/postgresql@12/include/server
LIBDIR | /usr/local/opt/postgresql@12/lib
PKGLIBDIR | /usr/local/Cellar/postgresql@12/12.10_1/lib/postgresql
LOCALEDIR | /usr/local/Cellar/postgresql@12/12.10_1/share/locale
MANDIR | /usr/local/Cellar/postgresql@12/12.10_1/share/man
SHAREDIR | /usr/local/opt/postgresql@12/share/postgresql@12
SYSCONFDIR | /usr/local/etc/postgresql
PGXS | /usr/local/Cellar/postgresql@12/12.10_1/lib/postgresql/pgxs/src/makefiles/pgxs.mk