Home > Enterprise >  Postgres extension AGE not getting loaded
Postgres extension AGE not getting loaded

Time:02-01

After starting the Postgres server process for a cluster: bin/pg_ctl -D demo -l logfile start Starting a process for a database 'demo': bin/psql demo

When I try to load AGE extension by

LOAD 'age'; It shows error that access to 'age' is denied. Do I need to change some security/credential information for the user?

I expected the extension to be loaded so that I can execute cypher queries.

CodePudding user response:

Run install check to see if postgresql and Apache AGE have been sucessfully installed without any error using the command in the age folder:

make PG_CONFIG=/home/path/to/age/bin/pg_config installcheck

and if this is the case then you have to create an extension of age and then load as follows:

CREATE EXTENSION age; 
Load 'age';

Now set Search Path and run a simple cypher query:

SET search_path = ag_catalog, "$user", public;
SELECT create_graph('demo_graph');

CodePudding user response:

To load the APACHE AGE extension, run the following commands after successful installation (verify using installcheck):

CREATE EXTENSION IF NOT EXISTS age;
LOAD 'age';
SET search_path = ag_catalog, "$user", public;

Create a graph using:

SELECT create_graph('graph_name');

To avoid running the load command each time, set the required parameters in the postgresql.conf file:

  • Locate the file at database_name/postgresql.conf (in your case, it would be demo/postgresql.conf)

  • Add the following lines to the file:

     shared_preload_libraries = 'age'
     search_path = 'ag_catalog, "$user", public'
    
  • Related