PostgreSQL v19 introduces a new `ON CONFLICT ... DO SELECT` clause for `INSERT` statements. This extends the existing upsert functionality by allowing you to retrieve rows that already existed in the table when a conflict occurs, rather than only returning newly inserted rows. The feature is most useful when combined with
Table of contents
What is INSERT ... ON CONFLICT ?Description of the new ON CONFLICT ... DO SELECTUse cases for ON CONFLICT ... DO SELECTWorking around the lack of ON CONFLICT ... DO SELECT in older PostgreSQL versionsWhy is there still no ON CONFLICT ... DO DELETE ?ConclusionSort: