On 11/20/2014 01:52 AM, Peter Geoghegan wrote:
On Mon, Nov 10, 2014 at 3:33 PM, Peter Geoghegan <p...@heroku.com> wrote:
Also, I think someone else mentioned this a few months back.

Yeah, that was me.

I think we have three options.

1. Return only inserted tuples
2. Return inserted and updated tuples
3. Return inserted, updated and skipped tuples

To me option 1 is surprising and less useful since I imagine in most cases where you do an upsert you do not care if the tuple was inserted or updated as long as it has the right values after the upsert, and these values is also what I would expect to be returned.

The possible use case I see for option 3 is when you want the values of automatically generated columns but there is actually no work to do if another transaction had already inserted the same row (same according to the unique constraints). But this behavior even though useful in certain cases might be surprising.

Andreas



--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to