Re: before insert for each row trigger on upsert

2020-02-20 Thread Tom Lane
Ted Toth writes: > I think you are right in that the trigger doesn't change the row being > updated (which is good) but it also updates another table and that's what > I'd actually like to avoid on update. Probably need to put that in an AFTER trigger, then. By definition, BEFORE triggers don't

Re: before insert for each row trigger on upsert

2020-02-20 Thread Adrian Klaver
On 2/20/20 1:03 PM, Ted Toth wrote: On Thu, Feb 20, 2020 at 2:32 PM Adrian Klaver > wrote: On 2/20/20 12:17 PM, Ted Toth wrote: > I'm a little confused why the before insert trigger fires al all but > since it does is  there a way to know that a

Re: before insert for each row trigger on upsert

2020-02-20 Thread Ted Toth
On Thu, Feb 20, 2020 at 2:32 PM Adrian Klaver wrote: > On 2/20/20 12:17 PM, Ted Toth wrote: > > I'm a little confused why the before insert trigger fires al all but > > since it does is there a way to know that an update will occur? > > Because ON CONFLICT DO UPDATE is part of an INSERT command.

Re: before insert for each row trigger on upsert

2020-02-20 Thread Adrian Klaver
On 2/20/20 12:17 PM, Ted Toth wrote: I'm a little confused why the before insert trigger fires al all but since it does is  there a way to know that an update will occur? Because ON CONFLICT DO UPDATE is part of an INSERT command. Basically I don't want the trigger affect the row on update.

before insert for each row trigger on upsert

2020-02-20 Thread Ted Toth
I'm a little confused why the before insert trigger fires al all but since it does is there a way to know that an update will occur? Basically I don't want the trigger affect the row on update. Ted