Re: Incorrect UPDATE trigger invocation in the UPDATE clause of an UPSERT statement. - Mailing list pgsql-bugs

From Peter Geoghegan
Subject Re: Incorrect UPDATE trigger invocation in the UPDATE clause of an UPSERT statement.
Date
Msg-id CAM3SWZStE7KxO8XCQ+biw5D9EGU41vh7T=djrhBi_jnD0DCQpw@mail.gmail.com
Whole thread Raw
In response to Re: Incorrect UPDATE trigger invocation in the UPDATE clause of an UPSERT statement.  (Peter Geoghegan <pg@heroku.com>)
List pgsql-bugs
On Tue, Dec 8, 2015 at 3:32 PM, Peter Geoghegan <pg@heroku.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

pgsql-bugs by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Incorrect UPDATE trigger invocation in the UPDATE clause of an UPSERT statement.
Next
From: tarunt@chisquare.in
Date:
Subject: BUG #13808: Upsert not working