age icon indicating copy to clipboard operation
age copied to clipboard

ERROR: operator does not exist: ag_catalog.agtype + ag_catalog.agtype

Open Sanjeetkumar163 opened this issue 2 years ago • 1 comments

I am getting an error when I ran the below queries in PostgreSQL-11:

SELECT * FROM ag_catalog.cypher('graph_path', $$ CREATE (:L {a: 1, b: 2, c: 3}), (:L {a: 2, b: 3, c: 1}), (:L {a: 3, b: 1, c: 2}) $$) as (a ag_catalog.agtype);

SELECT * FROM ag_catalog.cypher('graph_path', $$ MATCH (x:L) RETURN (x.a + x.b + x.c) + count(*) + count(*), x.a + x.b + x.c $$) as (count ag_catalog.agtype, key ag_catalog.agtype);

ERROR: operator does not exist: ag_catalog.agtype + ag_catalog.agtype LINE 1: ...her('graph_path', $$ MATCH (x:L) RETURN (x.a + x.b + x....                                                                                                   ^ HINT: No operator matches the given name and argument types. You might need to add explicit type casts.

Sanjeetkumar163 avatar Sep 15 '22 11:09 Sanjeetkumar163

psql-11.5-5432-pgsql=# SELECT create_graph('graph_path');
NOTICE:  graph "graph_path" has been created
 create_graph
--------------

(1 row)

psql-11.5-5432-pgsql=# SELECT * FROM ag_catalog.cypher('graph_path', $$ CREATE (:L {a: 1, b: 2, c: 3}), (:L {a: 2, b: 3, c: 1}), (:L {a: 3, b: 1, c: 2}) $$) as (a ag_catalog.agtype);
 a
---
(0 rows)

psql-11.5-5432-pgsql=# SELECT * FROM ag_catalog.cypher('graph_path', $$ MATCH (x:L) RETURN (x.a + x.b + x.c) + count(*) + count(*), x.a + x.b + x.c $$) as (count ag_catalog.agtype, key ag_catalog.agtype);
 count | key
-------+-----
 12    | 6
(1 row)

psql-11.5-5432-pgsql=#

This works for me,... how did you load the extension?

jrgemignani avatar Sep 15 '22 20:09 jrgemignani