Re: Incorrect UPDATE trigger invocation in the UPDATE clause of an UPSERT statement.

From: Peter Geoghegan <pg(at)heroku(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>, Stanislav Grozev <tacho(at)daemonz(dot)org>, PostgreSQL mailing lists <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Incorrect UPDATE trigger invocation in the UPDATE clause of an UPSERT statement.
Date: 2015-12-09 05:37:13
Message-ID: CAM3SWZStE7KxO8XCQ+biw5D9EGU41vh7T=djrhBi_jnD0DCQpw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Dec 8, 2015 at 3:32 PM, Peter Geoghegan <pg(at)heroku(dot)com> wrote:
> We're on the same page. I just happen to think we might as well put
> the check beside the existing special case check for weird before
> triggers -- within ExecUpdate()'s HeapTupleSelfUpdated case. That
> avoids an extra HeapTupleSatisfiesUpdate() call for every UPSERT
> update. We mostly only call that routine from heapam.c as things are.
> But I'm hardly going to insist on that.

Attached is a worked out patch, with the small differences I went
into. Take from it what you want.

--
Peter Geoghegan

Attachment Content-Type Size
0001-Fix-AFTER-UPDATE-trigger-behavior.patch text/x-patch 9.2 KB

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message tarunt 2015-12-09 09:01:53 BUG #13808: Upsert not working
Previous Message Peter Geoghegan 2015-12-08 23:42:38 Re: Incorrect UPDATE trigger invocation in the UPDATE clause of an UPSERT statement.