Re: How to avoid Trigger ping/pong / infinite loop

2023-02-16 Thread Ken Tanzer
On Thu, Feb 16, 2023 at 9:43 AM Dominique Devienne wrote: > Hi. I have a large "legacy" code base that write information necessary for > Row-Level-Security in a highly denormalized custom had-hoc text format for > values, in key-value pairs in a table, which would be either impossible or > too sl

Re: How to avoid Trigger ping/pong / infinite loop

2023-02-16 Thread Adrian Klaver
On 2/16/23 10:21, Dominique Devienne wrote: On Thu, Feb 16, 2023 at 6:58 PM Adrian Klaver > wrote: "... which would be either impossible or too slow to base any RLS policy on." and "At time point, changing the legacy code base is not really an

Re: How to avoid Trigger ping/pong / infinite loop

2023-02-16 Thread David Wheeler
>> 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

Re: How to avoid Trigger ping/pong / infinite loop

2023-02-16 Thread David G. Johnston
On Thu, Feb 16, 2023 at 10:43 AM Dominique Devienne wrote: > Are there techniques for situations like this? > > This question is not too far from my earlier question, in the sense that a > trigger would need to know the context in which it was triggered, i.e. > directly (then update the other mod

Re: How to avoid Trigger ping/pong / infinite loop

2023-02-16 Thread Dominique Devienne
On Thu, Feb 16, 2023 at 6:58 PM Adrian Klaver wrote: > > "... which would be either impossible or too slow to base any RLS policy > on." > > and > > "At time point, changing the legacy code base is not really an option..." > > seem to be at odds. > I don't see why you say that. So is the curren

Re: How to avoid Trigger ping/pong / infinite loop

2023-02-16 Thread Adrian Klaver
On 2/16/23 09:43, Dominique Devienne wrote: Hi. I have a large "legacy" code base that write information necessary for Row-Level-Security in a highly denormalized custom had-hoc text format for values, in key-value pairs in a table, which would be either impossible or too slow to base any RLS p