I am trying to create a graph in PostgreSQL using the "age" extension, but I am encountering an issue. Can anyone assist me in resolving this problem?
i have searched the catalog but still cant find the solution
select * from pg_proc where proname like 'create_%';.
.Make sure that the "age" extension is properly installed in your PostgreSQL database. You can check if it is installed by running the command \dx in the psql command-line interface. If "age" is listed in the output, it is installed. 2.Check the version of PostgreSQL you are running and make sure that it is compatible with the version of the "age" extension you have installed. 3.Review the documentation for the "age" extension and the create_graph() function to ensure that you are using the correct syntax and parameters. 4.Make sure that you have the necessary permissions to create a graph in your database. GRANT permission to your role to execute this function I have tried all these steps still unable to solve the issue
CodePudding user response:
I am hoping that you created an AGE extension and the loaded it using:
CREATE EXTENSION age;
Load 'age';
You might have not set the search path, set it using the following command:
SET search_path = ag_catalog, "$user", public;
Now create a simple graph:
SELECT create_graph('demo_graph');
CodePudding user response:
Muhammad Zahid's answer is totally correct. But you can also modify the postgresql.conf
file inside your database directory so that it loads age and sets the search path automatically.
Here is how to do this:
- Go to your database directory and open the
postgresql.conf
file with vim:
- Modify the
search_path
andshared_preload_libraries
like the image below: (you can search these strings by typping " / " and then passing the string that you are looking for)
- Save and quit with the
:wq
command.
Now you don't need to do the LOAD 'age';
and the SET search_path = ag_catalog, "$user", public;
every time you run postgres.