Re: INSERT ... ON CONFLICT {UPDATE | IGNORE}

Peter Geoghegan <pg@heroku.com>

From: Peter Geoghegan <pg@heroku.com>
To: Simon Riggs <simon@2ndquadrant.com>
Cc: Bruce Momjian <bruce@momjian.us>, Josh Berkus <josh@agliodbs.com>, Kevin Grittner <kgrittn@ymail.com>, Andres Freund <andres@2ndquadrant.com>, Heikki Linnakangas <hlinnakangas@vmware.com>, Pg Hackers <pgsql-hackers@postgresql.org>, Craig Ringer <craig@2ndquadrant.com>
Date: 2014-10-09T08:58:29Z
Lists: pgsql-hackers
On Thu, Oct 9, 2014 at 1:56 AM, Peter Geoghegan <pg@heroku.com> wrote:
> My point is that people are not really inclined to use an alias in
> UPDATEs in general when referring to the target. The thing that seems
> special (and worthy of special qualification) is the reference to what
> you call the "incoming data", and what I've called "tuples proposed
> for insertion" (after being affected by any before row triggers).

For simple cases, you might not even bother with CONFLICTING() - you
might find it easier to just repeat the constant in the INSERT and
UPDATE parts of the query.

-- 
Peter Geoghegan


Commits

  1. Change the way we mark tuples as frozen.

  2. Add documentation for data-modifying statements in WITH clauses.