Here is a prototype implementation of SQL property graph queries
(SQL/PGQ), following SQL:2023. This was talked about briefly at the
FOSDEM developer meeting, and a few people were interested, so I
wrapped up what I had in progress into a presentable form.
There is some documentation to get started in doc/src/sgml/ddl.sgml
and doc/src/sgml/queries.sgml.
To learn more about this facility, here are some external resources:
* An article about a competing product:
https://oracle-base.com/articles/23c/sql-property-graphs-and-sql-pgq-23c
(All the queries in the article work, except the ones using
vertex_id() and edge_id(), which are non-standard, and the JSON
examples at the end, which require some of the in-progress JSON
functionality for PostgreSQL.)
* An academic paper related to another competing product:
https://www.cidrdb.org/cidr2023/papers/p66-wolde.pdf (The main part
of this paper discusses advanced functionality that my patch doesn't
have.)
* A 2019 presentation about graph databases:
https://www.pgcon.org/2019/schedule/events/1300.en.html (There is
also a video.)
* (Vik has a recent presentation "Property Graphs: When the Relational
Model Is Not Enough", but I haven't found the content posted
online.)
The patch is quite fragile, and treading outside the tested paths will
likely lead to grave misbehavior. Use with caution. But I feel that
the general structure is ok, and we just need to fill in the
proverbial few thousand lines of code in the designated areas.