Re: When use triggers? - Mailing list pgsql-general

From Ken Tanzer
Subject Re: When use triggers?
Date
Msg-id CAD3a31Xbuk2K777RTX-pVKKnhExe7SpU6VtBSHq71GCLijhdnA@mail.gmail.com
Whole thread Raw
In response to Re: When use triggers?  (Melvin Davidson <melvin6925@gmail.com>)
List pgsql-general
On Fri, May 18, 2018 at 12:45 PM, Melvin Davidson <melvin6925@gmail.com> wrote:

 
> I have used triggers to keep audit-logs of changes to certain columns in a table
Another good use for triggers is to maintain customer balance..EG: An INSERT, UPDATE or DELETE involving a customer payment
(or in the case of banks (deposit or withdrawals) would automatically maintain the balance in the customer master record.

Another scenario is if you want to put a (check) constraint on your table that refers to other rows or tables.  You can't actually do that, and need to use a trigger instead.

--
AGENCY Software  
A Free Software data system
By and for non-profits
(253) 245-3801

learn more about AGENCY or
follow the discussion.

pgsql-general by date:

Previous
From: Melvin Davidson
Date:
Subject: Re: When use triggers?
Next
From: Berend Tober
Date:
Subject: Re: When use triggers?