Friday, August 07, 2026

PostgreSQL 19 Property Graph Queries (SQL/PGQ)

 Waiting for PostgreSQL 19 – SQL Property Graph Queries (SQL/PGQ) – select * from depesz;

Instead of usual:

select
    count(*)
from
    knows k1
    join knows k2 on k1.b = k2.a
where
    k1.a = 42;

we're supposed to write:

SELECT count(*) FROM GRAPH_TABLE(big_social
    MATCH (a IS person WHERE a.id = 42)-[IS knows]->(b IS person)-[IS knows]->(c IS person)
    COLUMNS (c.id));

No comments: