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

Peter Geoghegan <pg@heroku.com>

From: Peter Geoghegan <pg@heroku.com>
To: Simon Riggs <simon@2ndquadrant.com>
Cc: Robert Haas <robertmhaas@gmail.com>, 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-11-20T00:52:16Z
Lists: pgsql-hackers
On Mon, Nov 10, 2014 at 3:33 PM, Peter Geoghegan <pg@heroku.com> wrote:
> Attached is V1.4.

Someone mentioned to me privately that they weren't sure that the
question of whether or not RETURNING only projected actually inserted
tuples was the right one. Also, I think someone else mentioned this a
few months back. I'd like to address this question directly sooner
rather than later, and so I've added a note on the Wiki page in
relation to this [1]. It's a possible area of concern at this point.

Anyway, it wouldn't require much implementation effort to change the
behavior so that updated tuples were also projected. In addition, we
might also consider the necessity of inventing a mechanism to make
apparent whether the tuple was inserted or updated. The discussion
needs to happen first, though.

[1] https://wiki.postgresql.org/wiki/UPSERT#RETURNING_behavior
-- 
Peter Geoghegan


Commits

  1. Change the way we mark tuples as frozen.

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