Representing Graphs in PostgreSQL
richard-towers.com
Representing Graphs in PostgreSQL
1–10 of 80 posts
Re: Representing Graphs in PostgreSQL
#2Re: Representing Graphs in PostgreSQL
#3Re: Representing Graphs in PostgreSQL
#4There is also https://age.apache.org/ , an extension to facilitate graph queries in postgresql.
Re: Representing Graphs in PostgreSQL
#5There is also https://age.apache.org/ , an extension to facilitate graph queries in postgresql.
Re: Representing Graphs in PostgreSQL
#6Re: Representing Graphs in PostgreSQL
#7There is also https://age.apache.org/ , an extension to facilitate graph queries in postgresql.
Glad they used Cypher. One of the best and most intuitive query languages I've used personally.
Re: Representing Graphs in PostgreSQL
#8That said - i WISH people would embrase the existing GraphDatabases more and make the hosters support them as standard, rather than abusing existing relational databases for graph purposes.
And to make it clear,i'm not talking about my own experimental one, i mean stuff like Neo4j, OrientDB etc.
Re: Representing Graphs in PostgreSQL
#9I forgot to say that it's also obviously only a tree, not a graph. It's still useful for some cases.
It has a very good way of querying which is probably fast if you have very deep trees but in the end we didn't need the deep trees so it was chosen for the wrong reasons.
https://www.postgresql.org/docs/current/ltree.html
You essentially have a path field in your record which lists the ids of all the records that are parents of the current one plus the current one.
e.g. if your records are regions of the world and the id is the country name then the path might look like this:
Earth.Europe.Poland
There is support for queries like "what are all the descendants of Europe"
SELECT name FROM regions WHERE path
Or you can use matching: SELECT name FROM regions WHERE path ~ '*.Europe.*';Re: Representing Graphs in PostgreSQL
#10Earlier quoted context omitted.
Glad they used Cypher. One of the best and most intuitive query languages I've used personally.
Yeah Cypher was so good and made everything so intuitive. Loved working with Neo4J for a prototype and then had to face the licensing issues and huge costs and had to abandon it.