Re: Per row status during INSERT .. ON CONFLICT UPDATE?

From: Robins Tharakan <tharakan(at)gmail(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Per row status during INSERT .. ON CONFLICT UPDATE?
Date: 2015-05-19 20:07:04
Message-ID: CAEP4nAyFfgLm=9sx+93LPrqd41ODenuYjip0eiTJ6kGHAYQ70g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 19 May 2015 at 23:24, Peter Geoghegan <pg(at)heroku(dot)com> wrote:

> That's certainly something we talked about. It could probably be done
> with some kind of magical expression. I have to wonder how many of the
> people that are sure that they need this really do, though. Is it
> really natural to care about this distinction with idiomatic usage?
>

Thanks everyone for responding promptly.

​Not sure if I can be authoritative for many, but for me, the need emanates
from having to move an ETL off MSSQL Server, which supports OUTPUT $action
(similar to RETURNING * in Postgres​) where $action is the per-row status
(INSERT / UPDATE).

My use-case is to create an extra row for all UPDATEd rows (only), which is
implemented in MSSQL by enveloping the MERGE with an INSERT (MERGE ...
OUTPUT $action) WHERE $action = 'UPDATE'.

Am still to test, but looks like Thom's reply earlier could take care of my
use-case, so we may need more people requesting this magic field, with a
valid use-case.

--
Robins Tharakan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2015-05-19 20:12:39 Re: INSERT ... ON CONFLICT DO UPDATE with _any_ constraint
Previous Message Geoff Winkless 2015-05-19 19:57:43 Re: INSERT ... ON CONFLICT DO UPDATE with _any_ constraint