Assuming I have a customer graph in apache AGE, and I make the following query:
SELECT *
FROM cypher("customers",
$$
MATCH (p:person)
RETURN p.first_name, p.last_name
$$
) as (first_name agtype, last_name agtype)
I get the following result:
first_name | last_name
-------------+-----------
John | Doe
Matthew | Martinez
Melissa | Moore
How do I determine the data type of these 2 columns? I know that internally AGE keeps track of different types (like int, float etc), but to postgres these columns are all of type 'agtype'.
Looking at the above example, I already know that first_name and last_name are VARCHAR. So if I wanted to CAST first_name from 'agtype' to VARCHAR I could, but is there any way to determine this without having to guess the type?
For example, if a query from AGE returns a column zip_code, and the zip_code property is stored internally in AGE as an INT, how would I CAST agtype zip_code to the correct type instead of having to guess between INT and VARCHAR?