Re: Trigger not firing

2020-06-01 Thread Adrian Klaver
On 6/1/20 3:09 AM, Hans wrote: I've had a weird problem in a production system. The customer had installed a new server with our software on it. The software installs a Postgres database schema that includes a number of triggers. The triggers perform inserts into an additional table. How is t

Re: Trigger not firing

2020-06-01 Thread Hans
you trigger can be much faster if you replace FOREACH cycle by unnest INSERT INTO generic.usergroup_test(test_id, usergroup_id) VALUES(NEW.id, UNNEST(NEW.usergroup_ids)); Thanks! Appreciated :-) Hans

Re: Trigger not firing

2020-06-01 Thread Pavel Stehule
po 1. 6. 2020 v 12:09 odesílatel Hans napsal: > >> I've had a weird problem in a production system. The customer had > >> installed a new server with our software on it. The software installs > >> a Postgres database schema that includes a number of triggers. The > >> triggers perform inserts int

Re: Trigger not firing

2020-06-01 Thread Hans
I've had a weird problem in a production system. The customer had installed a new server with our software on it. The software installs a Postgres database schema that includes a number of triggers. The triggers perform inserts into an additional table. How is the install done? Our instructi

Re: Trigger not firing

2020-05-31 Thread Adrian Klaver
On 5/31/20 6:19 AM, Hans wrote: Hi, I've had a weird problem in a production system. The customer had installed a new server with our software on it. The software installs a Postgres database schema that includes a number of triggers. The triggers perform inserts into an additional table.

Trigger not firing

2020-05-31 Thread Hans
Hi, I've had a weird problem in a production system. The customer had installed a new server with our software on it. The software installs a Postgres database schema that includes a number of triggers. The triggers perform inserts into an additional table. In this installation, from what I

Re: Cascade Trigger Not Firing

2019-09-16 Thread George Neuner
On Sat, 14 Sep 2019 10:00:18 -0500, Ron wrote: >On 9/14/19 9:54 AM, Tom Lane wrote: >[snip >> The only mention of this feature in 38.1 "Overview of Trigger Behavior" >> is >> >> UPDATE triggers*can* moreover be set to fire only if certain columns >> are mentioned in the SET clause of t

Re: Cascade Trigger Not Firing

2019-09-14 Thread Ron
On 9/14/19 9:54 AM, Tom Lane wrote: [snip The only mention of this feature in 38.1 "Overview of Trigger Behavior" is UPDATE triggers*can* moreover be set to fire only if certain columns are mentioned in the SET clause of the UPDATE statement. which seems to me to be plenty specific e

Re: Cascade Trigger Not Firing

2019-09-14 Thread Tom Lane
Adrian Klaver writes: > On 9/13/19 8:07 PM, Judy Loomis wrote: >> At the very least that note about this behavior should be highlighted, >> probably on the Trigger Behavior page and not buried in a bunch of notes >> on the Create Trigger page. > I know this after the fact. Still, as a general r

Re: Cascade Trigger Not Firing

2019-09-14 Thread Adrian Klaver
On 9/13/19 8:07 PM, Judy Loomis wrote: At the very least that note about this behavior should be highlighted, probably on the Trigger Behavior page and not buried in a bunch of notes on the Create Trigger page. I know this after the fact. Still, as a general rule the best place to start when

Re: Cascade Trigger Not Firing

2019-09-13 Thread Judy Loomis
At the very least that note about this behavior should be highlighted, probably on the Trigger Behavior page and not buried in a bunch of notes on the Create Trigger page. On Fri, Sep 13, 2019 at 4:03 PM Tom Lane wrote: > Judy Loomis writes: > > I'm going to have to really look at all my BEFO

Re: Cascade Trigger Not Firing

2019-09-13 Thread Tom Lane
Judy Loomis writes: > I'm going to have to really look at all my BEFORE UPDATE triggers and make > sure we're not missing any more. > And I have to stop telling management that a trigger means we always know > when a value changes. Well, you can rely on that, just not like this. Use an AFTER tri

Re: Cascade Trigger Not Firing

2019-09-13 Thread Judy Loomis
I thought that might be the answer, but it's a pretty big hole when we're using triggers for audit purposes on financial data. I'm going to have to really look at all my BEFORE UPDATE triggers and make sure we're not missing any more. And I have to stop telling management that a trigger means we

Re: Cascade Trigger Not Firing

2019-09-13 Thread Tom Lane
Judy Loomis writes: > I have a trigger that updates a target column when some other columns > change. > There is another trigger on the target column to update another table (the > column can be changed in other ways besides the first trigger). > If I update the target column directly the expected

Cascade Trigger Not Firing

2019-09-13 Thread Judy Loomis
I have a trigger that updates a target column when some other columns change. There is another trigger on the target column to update another table (the column can be changed in other ways besides the first trigger). If I update the target column directly the expected trigger fires. But if the 1