I have done:
test=# SET search_path = ag_catalog, "$user", public;
But still I can not use create_graph
function directly.
test=# create_graph('university');
ERROR: syntax error at or near "create_graph"
LINE 1: create_graph('university');
Why I need to do this using ag_catalog
:
test=# SELECT * FROM ag_catalog.create_graph('university');
4
Answers
Your first query is incorrect because you are not using correct syntax.
This will work
but this will not
You don’t to use the
ag_catalog
for every apacheAGE function that you use. You can just use :SELECT * FROM create_graph('graph');
The reason you need
SELECT *
is to signify to the backend to give results to you, I believe all apacheAGE functions need that.You encountered a syntax error because you failed to use the
SELECT
statement, try modifying your query;or
In the first query there is a syntax error it should be like that :
If you don’t want to write
ag_catalog
every time you execute a query than you should setsearch_path
as follow:This is because
create_graph
is present inag_catalog
namespace So, you need either to set namespace toag_catalog
usingsearch_path
or by addingag_catalog.
as a prefix of any function call inage
.