PostgreSQL 19 connects the dots with standardized graph queries

The Register ·

PostgreSQL 19, expected later this month or in early October, will introduce standardised SQL syntax for querying property graphs, marking a significant step in the open-source database's ongoing expansion of graph capabilities. Unlike earlier approaches, which relied on Object Relational Mapping layered on top of the database, the new feature bakes graph query syntax directly into PostgreSQL, potentially reducing the need for organisations to run a separate graph database alongside their relational one for certain workloads.

The addition implements SQL/PGQ, part of the SQL 2023 standard, and according to Alastair Turner, a PostgreSQL evangelist at Percona, it emerged from unusually broad collaboration among major contributors to the database, including engineers influenced by OpenCypher and PostgreSQL committers who also sit on SQL standards bodies. Turner said the implementation performs well for some queries but still lacks one or two additional syntax features, and future releases will need improved indexing to boost performance before it can fully rival dedicated graph databases for demanding workloads.

In short

  • PostgreSQL 19 adds native SQL syntax for graph database queries.
  • Feature implements the SQL/PGQ 2023 standard via multi-vendor collaboration.
  • Indexing improvements still needed to match dedicated graph databases' performance.

Steelman: both sides, in good faith

The strongest fair case each way — we don't pick a winner.

The case for

Adding standardised graph queries directly to PostgreSQL could simplify systems for organisations whose graph workloads are modest or closely tied to relational data. A shared SQL standard and broad contributor collaboration may also make graph capabilities more accessible, reduce reliance on extra infrastructure, and encourage interoperability.

The case against

A built-in feature does not necessarily replace specialised graph databases for demanding workloads: the reported implementation still lacks some syntax and needs better indexing to improve performance. Organisations with complex graph needs may therefore still require dedicated systems, while adopting the feature too early could mean accepting limits in capability or speed.

Explained simply

PostgreSQL is a widely used open-source database that stores information in tables, such as rows of customers, products or transactions. A property graph represents information as points, called nodes, linked by relationships; both can carry details such as names or dates. This makes graph queries useful for exploring how records are connected.

SQL is the common language used to ask relational databases questions about their data. SQL/PGQ is a standardised way to use SQL to query property graphs, included in the SQL 2023 standard. Its addition to PostgreSQL reflects work by contributors from across the database community, including people with experience of graph-query languages and SQL standards.

For some tasks, querying graph-shaped data within PostgreSQL could reduce the need to maintain a separate graph database. How suitable it is depends on the workload: performance and available query features matter, particularly for demanding graph analysis. Dedicated graph databases may still be useful where those needs are greater.

Software

Read the full article at the source →

Log in to join the discussion