Re: How to avoid Trigger ping/pong / infinite loop - Mailing list pgsql-general

From David Wheeler
Subject Re: How to avoid Trigger ping/pong / infinite loop
Date
Msg-id 87FC4042-E7F1-4A53-AE60-1C84B5276713@gmail.com
Whole thread Raw
In response to Re: How to avoid Trigger ping/pong / infinite loop  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-general

Are there techniques for situations like this?

Just have two triggers, one for each column, and ensure that if your trigger doesn’t change the value then it doesn’t do an update on the other column. Each time you do update both triggers will run but only one will make a change, so that will break the cycle

For insert case ensure the triggers do nothing if their source col is null

pgsql-general by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Automatic aggressive vacuum on almost frozen table takes too long
Next
From: Adrian Klaver
Date:
Subject: Re: DELETE trigger, direct or indirect?