I am trying to install apacheage with the help of documentation. But I was having the same problems as asked in the question. So, I followed this answer to the above question.
All the errors which I was getting was solved but I am now getting the this new error. I tried using sudo but this error remains same.
/usr/bin/install -c -m 755 age.so '/usr/lib/postgresql/12/lib/age.so'
/usr/bin/install: cannot create regular file '/usr/lib/postgresql/12/lib/age.so': Permission denied
make: *** [/usr/lib/postgresql/12/lib/pgxs/src/makefiles/../../src/Makefile.shlib:487: install-lib-shared] Error 1
I am using Ubuntu 22.04 and installed postgresql using
sudo apt install postgresql-server-dev-12
.
I tried installing using master branch branch but I am getting the following error with that.
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
4
Answers
To fix the "Permission denied" error, you need to grant write permission to the directory where you’re trying to install the extension. You can do this by running the command:
Note that
postgresql-server-dev-12
only install header files, not postgreSQL itself. And you don’t need these header files anymore because latest versions of postgreSQL include these in their standard installation.Follow this guide instead to install PostgreSQL and Apache AGE:
Apache Age Installation
If you are installing Apache AGE for PostgreSQL 12, make sure to install from the latest stable release and avoid using the master branch. To do this, just use the following command:
git checkout release/PG12/1.1.0
. Then, you can install Apache AGE from this branch.You need to provide write/update permissions to the directory. For this execute the following command with path to the directory:
This command gives write permission. Also substitute path to your directory accordingly.
The second error that you got is because of version incompatibility between AGE and PostgreSQL. Try installing again with the compatible versions of both.
For PostgreSQL 12, AGE Alpha branch should be used while others are compatible with PostgreSQL 11.
Link for postgres 12 compatible AGE branch: https://github.com/apache/age/tree/AGE_PG12.1.0_ALPHA