You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@age.apache.org by GitBox <gi...@apache.org> on 2022/03/22 07:48:45 UTC

[GitHub] [incubator-age] emotionbug edited a comment on issue #202: Parsing results?

emotionbug edited a comment on issue #202:
URL: https://github.com/apache/incubator-age/issues/202#issuecomment-1074831960


   there is a casting for the basic type. so, it can be used as follows.
   
   ```
   postgres=# SELECT create_graph('test');
   SELECT * FROM cypher('test', $$
   MATCH (n) RETURN n.name
   $$) as (i text);
   postgres=# SELECT * FROM cypher('test', $$
   CREATE (a {name: 'Alex'} )
   $$) as (i agtype);
    i
   ---
   (0 rows)
   postgres=# SELECT * FROM cypher('test', $$
   MATCH (n) RETURN n.name
   $$) as (i text);
     i
   ------
    Alex
   (1 row)
   postgres=# SELECT cypher.i, pg_typeof(cypher.i) FROM (SELECT * FROM cypher('test', $$
   postgres$# MATCH (n) RETURN n.name
   postgres$# $$) as (i text)) cypher;
     i   | pg_typeof
   ------+-----------
    Alex | text
   (1 row)
   postgres=# SELECT i::text, pg_typeof(i::text) FROM cypher('test', $$
   postgres$# MATCH (n) RETURN n.name
   postgres$# $$) as (i agtype);
     i   | pg_typeof
   ------+-----------
    Alex | text
   (1 row)
   ```


-- 
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: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org