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

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: Anssi Kääriäinen <anssi(dot)kaariainen(at)thl(dot)fi>, Peter Geoghegan <pg(at)heroku(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, Josh Berkus <josh(at)agliodbs(dot)com>, Kevin Grittner <kgrittn(at)ymail(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: INSERT ... ON CONFLICT {UPDATE | IGNORE}
Date: 2014-12-04 11:04:34
Message-ID: 54803FC2.9020903@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 12/04/2014 07:07 PM, Anssi Kääriäinen wrote:
> On Wed, 2014-11-26 at 16:59 -0800, Peter Geoghegan wrote:
>> On Mon, Nov 24, 2014 at 1:03 PM, Peter Geoghegan <pg(at)heroku(dot)com> wrote:
>>> Looks like the consensus is that we should have RETURNING project
>>> updated tuples too, then.
>>
>> Attached revision, v1.5, establishes this behavior (as always, there
>> is a variant for each approach to value locking). There is a new
>> commit with a commit message describing the new RETURNING/command tag
>> behavior in detail, so no need to repeat it here. The documentation
>> has been updated in these areas, too.
>
> It seems there isn't any way to distinguish between insert and update of
> given row. Maybe a pseudo-column can be added so that it can be used in
> the returning statement

Yes, I think that's pretty important. With a negative attno so it's
treated as a "hidden" col that must be explicitly named to be shown and
won't be confused with user columns.

--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Anssi Kääriäinen 2014-12-04 11:07:08 Re: INSERT ... ON CONFLICT {UPDATE | IGNORE}
Previous Message Rahila Syed 2014-12-04 10:36:36 Re: [REVIEW] Re: Compression of full-page-writes