I wanted to create a materialized view from a label table and then create indexes on it. However, when I type the query to create this view, postgres pops an error.
Here is the query that I type to return all the vertices containing the "Book" label :
demo=# SELECT * FROM cypher ('demo', $$
demo$# MATCH (v:Book)
demo$# RETURN v
demo$# $$) as (vertex agtype);
vertex
---------------------------------------------------------------------------------------------------------------------------------------
{"id": 1125899906842625, "label": "Book", "properties": {"title": "The Hobbit"}}::vertex
{"id": 1125899906842626, "label": "Book", "properties": {"title": "SPQR: A History of Ancient Rome", "author": "Mary Beard"}}::vertex
(2 rows)
Here is the way that I'm creating the materialized view :
demo=# CREATE MATERIALIZED VIEW book_view AS SELECT * FROM cypher ('demo', $$
MATCH (v:Book)
RETURN v.author, v.title
$$) as (author agtype, title agtype);
ERROR: unhandled cypher(cstring) function call
DETAIL: demo