-- Inserting nothing
SELECT * FROM cypher() as (a agtype);
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
-- Not inserting the double dollar signs
SELECT * FROM cypher('graph_name') as (a agtype);
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Failed. ^
-- Not passing the query correctly
SELECT * FROM cypher('graph_name', $$$$) as (a agtype);
ERROR: syntax error at end of input
LINE 1: SELECT * FROM cypher('graph_name', $$$$) as (a agtype);
1条答案
按热度按时间jdzmm42g1#
cypher函数语法如下所示:
因此,有必要将图形的名称作为第一个参数传递,并将查询作为第二个参数传递(注意,查询的开头和结尾必须有两个美元符号)。如果未传递这些参数,则会发生错误,因为函数将无法标识其正在处理的列和名称空间。以下是一些错误示例:
documentation还指出,我们需要考虑两件事:
第一点意味着,如果查询没有返回结果(例如,试图返回不属于顶点或边的属性),则在返回查询时仍然需要显示表结构,即使它是空的。