Skip to content
Planet PostgreSQL·· 20h agoFeatured

PostgreSQL 19 Adds INSERT … ON CONFLICT DO SELECT Support

Hubert 'depesz' Lubaczewski: Missed in PostgreSQL 19 : Add support for INSERT … ON CONFLICT DO SELECT.

Brief · Based on the source excerpt

PostgreSQL 19 adds INSERT ... ON CONFLICT DO SELECT to return existing rows on conflict. Dean Rasheed committed the patch on February 12, 2026. The syntax requires RETURNING and optionally accepts FOR UPDATE or FOR SHARE.

Why It Matters

When a single statement needs to attempt an insert and read the existing row on conflict, DO SELECT works as long as the statement includes a RETURNING clause.

Source: Planet PostgreSQL· postgr.es

PG Radar summarizes verified changes and impact. Read the original post for full technical details and code samples.

Read Official Source

Related PostgreSQL Reference