User-defined functions

更新时间:
复制 MD 格式

Apache AGE (AGE) lets you call functions from any PostgreSQL namespace inside a Cypher query. By default, Cypher resolves all function calls against the ag_catalog namespace, so functions in that namespace need no prefix. To call a function from a different namespace—such as a PostgreSQL built-in or a custom function registered in another schema—prefix the function name with the target namespace.

Syntax

namespace_name.function_name

Example

The following query calls sqrt from the pg_catalog namespace inside a Cypher expression:

SELECT *
FROM cypher('graph_name', $$
RETURN pg_catalog.sqrt(25)
$$) as (result agtype);

Output:

 result
--------
 5.0
(1 row)