Re: Per row status during INSERT .. ON CONFLICT UPDATE? - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: Per row status during INSERT .. ON CONFLICT UPDATE?
Date
Msg-id CAM3SWZRTWJP2X_sDbVAGDGp3tqaXFe74_4VPSKLYcQfn=t8X+A@mail.gmail.com
Whole thread Raw
In response to Re: Per row status during INSERT .. ON CONFLICT UPDATE?  (Peter Geoghegan <pg@heroku.com>)
List pgsql-hackers
On Tue, May 19, 2015 at 1:20 PM, Peter Geoghegan <pg@heroku.com> wrote:
> On Tue, May 19, 2015 at 1:07 PM, Robins Tharakan <tharakan@gmail.com> wrote:
>> 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'.
>
> That could make sense. You can achieve something similar with per-row
> triggers, perhaps.

BTW, be prepared to deal with the updated row (*any* row version) not
being visible to your MVCC snapshot with that pattern in Postgres (at
READ COMMITTED level). It probably won't matter, but it could.

-- 
Peter Geoghegan



pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Per row status during INSERT .. ON CONFLICT UPDATE?
Next
From: José Luis Tallón
Date:
Subject: Re: RFC: Non-user-resettable SET SESSION AUTHORISATION