I am using AgensGraph.
I know the PostgreSQL supports pl/python driver.
So I think the AgensGraph supports it, too.
If I want to use a graph data type using by pl/python, is the way same with general data?
Asked
Active
Viewed 144 times
0

Kevin Lee
- 121
- 7
1 Answers
0
In order to use PL/Python in AgensGraph you need to Create the plpythonu language.
A good example for PL/Python in AgensGraph would be as following:
Enabling the module
CREATE LANGUAGE plpythonu;
Creating sample data
CREATE (a:person {id:1,name:'Bob'});
Creating PL/Python function
CREATE OR REPLACE FUNCTION firstname()
RETURNS void
AS $$
#Python source code starts
records = plpy.execute("MATCH (a:person) RETURN a.name AS sample")
plpy.info(records[0]['sample'])
#Python source code ends
$$ LANGUAGE plpythonu;
Calling the function
SELECT firstname();
You can find more information in the following link: AgensGraph

Eya
- 121
- 4