I was installing Apache AGE using this guide https://age.apache.org/age-manual/master/intro/setup.html and have used sudo apt install postgresql-12
to install postgresql, but doing make install
in the age git directory is fetching me the following error:
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -ggdb -Og -fno-omit-frame-pointer -fPIC -I.//src/include -I.//src/include/parser -I. -I./ -I/usr/include/postgresql/server -I/usr/include/postgresql/internal -D_GNU_SOURCE -c -o src/backend/catalog/ag_graph.o src/backend/catalog/ag_graph.c
src/backend/catalog/ag_graph.c: In function ‘insert_graph’:
src/backend/catalog/ag_graph.c:67:15: error: void value not ignored as it ought to be
67 | graph_oid = CatalogTupleInsert(ag_graph, tuple);
| ^
make: *** [<builtin>: src/backend/catalog/ag_graph.o] Error 1
My pg_config path is usr/include/postgresql/pg_config.h
and earlier I was having the following error:
de/postgresql/internal -D_GNU_SOURCE -c -o src/backend/age.o src/backend/age.c
src/backend/age.c:20:10: fatal error: postgres.h: No such file or directory
20 | #include "postgres.h"
| ^~~~~~~~~~~~
compilation terminated.
make: *** [<builtin>: src/backend/age.o] Error 1
which I corrected by changing the path of server
from usr/include/postgresql/12/server/
to usr/include/postgresql/server
as pg_config
has that path as described by this How to fix 'postgres.h' file not found problem?.
I think that maybe my postgresql is not compatible with age as the CatalogTupleInsert
is defined in postgres so maybe that is returning void instead of graph_oid
. I have tried source code installation and it is working but I was not able to figure out why this error was there.
I am using WSL2 with Ubuntu 20.04.2 LTS and the postgresql version was 12.13