deniz.in

Markets

Weather

Loading weather

· via Hacker News – Front Page (native)

PostgreSQL 19 beta tour: property graphs, temporal edits and a smarter upsert

A hands-on VictoriaMetrics tour of PostgreSQL 19 beta 3 covers SQL/PGQ property graph queries, FOR PORTION OF temporal edits and ON CONFLICT DO SELECT, ahead of an expected autumn 2026 release.

PostgreSQL 19 beta tour: property graphs, temporal edits and a smarter upsert

PostgreSQL 19 approaches general availability

PostgreSQL 19 is in beta, with general availability expected around September or October 2026, and a hands-on tour published on the VictoriaMetrics blog, which surfaced on Hacker News's front page, gives developers a practical preview of what is coming. Rather than summarising the release notes, the article turns a selection of entries into runnable examples, all executed against PostgreSQL 19 beta 3 — released on 13 August 2026 — with the server's printed output shown alongside each feature. The tour draws on the official release notes and the PostgreSQL source code, and is presented as a companion to them rather than an exhaustive catalogue.

Property graphs are the headline feature

The centrepiece of the release, according to the VictoriaMetrics write-up, is SQL/PGQ, the property-graph portion of the SQL:2023 standard. A CREATE PROPERTY GRAPH statement layers a graph definition over ordinary tables — some marked as vertex tables, others as edge tables — without copying any data; the graph is a view-like object over existing rows. Queries then use GRAPH_TABLE with MATCH patterns, where a directed edge is written inline, so traversal questions become pattern matches instead of hand-written joins.

The benefit grows with multi-hop patterns: chaining two edges answers a friends-of-friends style question without a self-join, and an unnamed vertex acts as a wildcard for intermediate nodes. Notably, there is no new execution engine involved — GRAPH_TABLE is rewritten into a plain relational query, so the planner, statistics and index choices developers already rely on continue to apply. A sample plan in the article shows the pattern resolving into ordinary hash joins.

There is a caveat for anyone hoping to move off a dedicated graph database: this first implementation does not support variable-length paths. Quantifiers expressing a range of hops parse but are rejected with an "element pattern quantifier is not supported" error, so every hop in a pattern must be spelled out explicitly. The feature is credited in the release notes to Peter Eisentraut and Ashutosh Bapat.

Temporal updates and deletes split rows automatically

A second addition is the FOR PORTION OF clause, which applies UPDATE and DELETE to a slice of a range column. Instead of rewriting a whole validity period by hand, the developer names a sub-period and PostgreSQL performs the surgery. In the article's example, a single row holding a price valid for all of 2026 becomes three rows after a July-only price change: the updated month, plus the untouched periods on either side. DELETE trims rather than splits, and a NULL bound means unbounded, so removing a period "from December onwards" leaves the earlier portion intact. The feature arrives alongside a new documentation chapter on temporal tables and is credited to Paul A. Jungwirth.

Upsert can now report the rows it collided with

INSERT ... ON CONFLICT DO NOTHING ... RETURNING has always had a blind spot: rows that conflicted simply never appear in the result, making "already present" indistinguishable from "never processed". PostgreSQL 19 adds ON CONFLICT DO SELECT, which returns the existing rows without writing to them — in the demo, an attempt to insert a widget that already exists reports the stored quantity rather than the attempted one. The clause also accepts a locking clause, so FOR UPDATE can hold conflicting rows while the application decides what to do next; because locking stamps a row's xmax, the article notes that an xmax = 0 check distinguishes genuinely inserted rows from those that were already there.

Why it matters

SQL/PGQ in core PostgreSQL brings graph-style querying into the standard relational engine without requiring a separate graph database — though the missing variable-length paths mean it is not yet a full replacement for graph stores. Temporal handling removes bookkeeping that applications tracking validity periods have long done manually, and DO SELECT closes a long-standing ergonomics gap in upsert flows. With general availability expected in the autumn of 2026, trying the beta now — in a disposable environment, since betas are not production-ready — gives teams time to plan upgrades and judge which features justify an early move.

  • #postgresql
  • #databases
  • #sql
  • #open-source
  • #beta-release

Related posts