jrgemignani commented on issue #820:
URL: https://github.com/apache/age/issues/820#issuecomment-1513518484

   @moeed-k You need to specify the output type **and** you need to specify the 
name, like in @aru-d-at example above, and as illustrated below -
   
   ```
   psql-11.5-5432-pgsql=# SELECT * from cypher('graph1', $$ match (u) return u 
$$);
   ERROR:  a column definition list is required for functions returning "record"
   LINE 1: SELECT * from cypher('graph1', $$ match (u) return u $$);
                         ^
   psql-11.5-5432-pgsql=# SELECT * from cypher('graph2', $$ match (u) return u 
$$);
   ERROR:  a column definition list is required for functions returning "record"
   LINE 1: SELECT * from cypher('graph2', $$ match (u) return u $$);
                         ^
   psql-11.5-5432-pgsql=# SELECT * from cypher('graph1', $$ match (u) return u 
$$) as (result agtype);                                                         
                           result
   
-------------------------------------------------------------------------------------------------------------
    {"id": 281474976710657, "label": "", "properties": {}}::vertex
    {"id": 281474976710658, "label": "", "properties": {}}::vertex
    {"id": 844424930131969, "label": "zero", "properties": {"name": "Zero", 
"value": 2.71828182845905}}::vertex
   (3 rows)
   
   psql-11.5-5432-pgsql=# SELECT * from cypher('graph2', $$ match (u) return u 
$$) as (result agtype);
                                  result
   ---------------------------------------------------------------------
    {"id": 1407374883553281, "label": "loop", "properties": {}}::vertex
    {"id": 1407374883553282, "label": "loop", "properties": {}}::vertex
   (2 rows)
   
   psql-11.5-5432-pgsql=# SELECT * from cypher('graph1', $$ match (u) return u 
$$) as g1(result agtype), cypher('graph2', $$ match (u) return u $$) as 
g2(result agtype);
                                                      result                    
                                |
            result
   
-------------------------------------------------------------------------------------------------------------+----------------------
   -----------------------------------------------
    {"id": 281474976710657, "label": "", "properties": {}}::vertex              
                                | {"id": 14073748835532
   81, "label": "loop", "properties": {}}::vertex
    {"id": 281474976710657, "label": "", "properties": {}}::vertex              
                                | {"id": 14073748835532
   82, "label": "loop", "properties": {}}::vertex
    {"id": 281474976710658, "label": "", "properties": {}}::vertex              
                                | {"id": 14073748835532
   81, "label": "loop", "properties": {}}::vertex
    {"id": 281474976710658, "label": "", "properties": {}}::vertex              
                                | {"id": 14073748835532
   82, "label": "loop", "properties": {}}::vertex
    {"id": 844424930131969, "label": "zero", "properties": {"name": "Zero", 
"value": 2.71828182845905}}::vertex | {"id": 14073748835532
   81, "label": "loop", "properties": {}}::vertex
    {"id": 844424930131969, "label": "zero", "properties": {"name": "Zero", 
"value": 2.71828182845905}}::vertex | {"id": 14073748835532
   82, "label": "loop", "properties": {}}::vertex
   (6 rows)
   
   psql-11.5-5432-pgsql=#
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to