Re: Trigger usecase - Mailing list pgsql-general

From David G. Johnston
Subject Re: Trigger usecase
Date
Msg-id CAKFQuwakdL3D-0wkiou11ahxCtyMkCoraVZFu-bkmJ=NH8cJ2w@mail.gmail.com
Whole thread Raw
In response to Re: Trigger usecase  (sud <suds1434@gmail.com>)
Responses Re: Trigger usecase
List pgsql-general
On Tue, Jul 30, 2024 at 11:46 AM sud <suds1434@gmail.com> wrote:

Not sure of the exact pros and cons, but we were following certain rules like , if it's business logic which needs to be implemented in Database, then it should not be done using triggers but rather should be done through database procedure/functions. Hope this understanding correct.

That is my personal take.  For process-oriented stuff you can follow the trail of calls all the way through to the end of the process and its final result.  With triggers you follow the trail to the insert/update/delete then stop thinking that's it, while in reality it continues because you have triggers performing yet more work.

David J.

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Trigger usecase
Next
From: Adrian Klaver
Date:
Subject: Re: Trigger usecase