« All posts

PostgreSQL 19 Preview: Property Graph Queries and Temporal Updates

PostgreSQL 19 beta introduces SQL/PGQ graph queries, temporal FOR PORTION OF updates, and ON CONFLICT DO SELECT, shown through runnable examples.

PostgreSQL 19 is currently in beta, with general availability targeted for around September or October 2026. The headline feature is SQL/PGQ support, the property-graph portion of SQL:2023: you declare a graph over existing tables with CREATE PROPERTY GRAPH, then query it using pattern matching via GRAPH_TABLE instead of hand-writing joins. Under the hood these queries are rewritten into ordinary relational plans, so the existing planner, statistics, and indexes still apply—though variable-length path patterns are not yet supported in this first cut.

Another significant addition is the FOR PORTION OF clause for UPDATE and DELETE, which lets you modify or remove just a sub-period of a range column. PostgreSQL automatically splits the row so the unaffected portions of the validity period are preserved, removing the need to manually manage row-splitting logic for temporal data.

Finally, ON CONFLICT DO SELECT closes a long-standing gap in INSERT ... ON CONFLICT DO NOTHING ... RETURNING: conflicting rows are now returned without being modified, and an optional locking clause allows concurrency control over them. Together, these additions reflect PostgreSQL's continued push to extend the relational model into new query paradigms.

This synthesis was produced from its source by AI; there is no human editor or manual review step. How we work