bitnine-oss / agensgraph

AgensGraph, a transactional graph database based on PostgreSQL
http://www.agensgraph.org
Other
1.33k stars 148 forks source link

org.postgresql.util.PSQLException is reported when executing the Cypher query containing XOR #545

Closed abc123000111 closed 2 years ago

abc123000111 commented 2 years ago

I discovered that when I executed the following Cypher query: MATCH (n0) WHERE n0.k0 = 'a' XOR n0.k1 = 'b' RETURN n0 An error occurred: org.postgresql.util.PSQLException: ERROR: syntax error at or near "XOR" at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2477) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2190) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:300) at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:428) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:354) at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:301) at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:287) at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:264) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:260) at net.bitnine.agensgraph.jdbc.AgStatement.execute(AgStatement.java:113)

Version: 2.5.0 Operating System: Windows 11 API: Cypher/Java API

emotionbug commented 2 years ago

XOR operator is not implemented.

abc123000111 commented 2 years ago

XOR operator is not implemented.

Thanks! Are there any other openCypher features that AgensGraph does not support? It would be better if there are related documents that provide this information.

joefagan commented 2 years ago

You can use

MATCH (n0) 
WHERE (n0.k0 = 'a' AND n0.k1 <> 'b') 
OR (n0.k0 <> 'a' AND n0.k1 = 'b')
RETURN n0
abc123000111 commented 2 years ago

Thanks a lot!