0

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

5 Answers5

2

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');
  • As a follow up, you need to load the extension and set search_path in every session you open. Also you can check if the graph was created with the command `SELECT * FROM ag_graph;` – Marco Souza Jan 28 '23 at 15:00
0

Firstly, you need to verify the installation of AGE extension using this command:

SELECT * FROM pg_extension WHERE extname = 'age';

After verifying the installation, check the availability of create_graph() function using this command:

SELECT * FROM pg_proc WHERE proname = 'create_graph';

After verification, you can create a graph in a new database to resolve the error.

adil shahid
  • 125
  • 4
0

Did you set the search_path after loading the extension? As in

SET search_path = ag_catalog, "$user", public;

To confirm the age extension was loaded you can check if the ag_catalog is present in the schemas in the current database. You can list the schemas in the current database, if ag_catalog is present.

SELECT schema_name FROM information_schema.schemata;

You can also ignore loading the search_path as shown earlier but just make sure to prepend the ag_catalog prefix to any age objects for example to use the create_graph function. Use the following

SELECT * FROM ag_catalog.create_graph('test_graph');

You can also read this article to get a step by step guide on how to use and load age functions https://dev.to/shadycj/apache-age-getting-started-part-4age-query-formats-gd5

Peter
  • 43
  • 4
0

There can be problem with the installation. First drop the age extension using

DROP EXTENSION age CASCADE;

Reinstall apache age. And in the psql terminal run this command.

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

Now to create a graph

SELECT * FROM ag_catalog.create_graph('graph');
abhishek2046
  • 312
  • 1
  • 11
0

Here are some steps which might solve your problem.

  • Make sure you had installed a compatible version.
  • Make sure you have permission to create the graph.
  • Make sure you have set the search path, if not set it using this command: SET search_path = ag_catalog, "$user", public;