skip to Main Content

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.

3

Answers


  1. 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');
    
    Login or Signup to reply.
  2. 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'
      
    Login or Signup to reply.
  3. You might need superuser privileges as described here in order to execute the CREATE EXTENSION statement.

    Here’s a possible relevant issue with a solution in GitHub issues

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search