Open petrarca opened 3 days ago
@petrarca Here is a way -
psql-16.2-5432-psql=# SELECT * FROM cypher('test', $$ match (p) return ag_catalog.agtype_out(p) $$) as (p text);
p
------------------------------------------------------------------------------
{"id": 281474976710657, "label": "", "properties": {"name": "John"}}::vertex
(1 row)
psql-16.2-5432-psql=# SELECT pg_typeof(p) FROM cypher('test', $$ match (p) return ag_catalog.agtype_out(p) $$) as (p text);
pg_typeof
-----------
text
(1 row)
psql-16.2-5432-psql=#
psql-16.2-5432-psql=# SELECT * FROM cypher('test', $$ match (p) return ag_catalog.agtype_out(properties(p)) $$) as (p text); p
------------------
{"name": "John"}
(1 row)
psql-16.2-5432-psql=# SELECT pg_typeof(p) FROM cypher('test', $$ match (p) return ag_catalog.agtype_out(properties(p)) $$) as (p text);
pg_typeof
-----------
text
(1 row)
psql-16.2-5432-psql=#
Great. That works. Thank you very much!
@petrarca Yw. If this resolves your issue, please consider closing the ticket :)
Hello, there seems no way to convert a ::vertex or ::edge to a jsonb or ::text. There is a function agetype_to_text which works only on scalar-values but not on that data types.
-- does not work
-- does neither work
Any ideas to extract at least the properties for ::vertex or ::edge from SQL?