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

From: Peter Geoghegan <pg(at)heroku(dot)com>
To: Robins Tharakan <tharakan(at)gmail(dot)com>
Cc: "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:21:38
Message-ID: CAM3SWZRTWJP2X_sDbVAGDGp3tqaXFe74_4VPSKLYcQfn=t8X+A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, May 19, 2015 at 1:20 PM, Peter Geoghegan <pg(at)heroku(dot)com> wrote:
> On Tue, May 19, 2015 at 1:07 PM, Robins Tharakan <tharakan(at)gmail(dot)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

In response to

Browse pgsql-hackers by date

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