In the following code, it’s a simple query that fetches nodes that has the specified relation
test=# SELECT *
FROM cypher('first_graph', $$
MATCH (a:Person)-[]->(b:Person) RETURN a.name, b.name
$$) as (v agtype);
When I ran the query I get the following error
ERROR: return row and column definition list do not match
LINE 2: FROM cypher('first_graph', $$..
^
2
Answers
When you are returning more than 1 columns from cypher query, you need to specify exact number of columns outside the query.
The above query will work fine.
You always need to add the same number of agtypes at the
RETURN
clause to match theRETURN
values inside your cypher query