From: | Ken Tanzer <ken(dot)tanzer(at)gmail(dot)com> |
---|---|
To: | Melvin Davidson <melvin6925(at)gmail(dot)com> |
Cc: | Vick Khera <vivek(at)khera(dot)org>, "pgsql-general(at)postgresql(dot)org >> PG-General Mailing List" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: When use triggers? |
Date: | 2018-05-18 23:28:52 |
Message-ID: | CAD3a31Xbuk2K777RTX-pVKKnhExe7SpU6VtBSHq71GCLijhdnA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Fri, May 18, 2018 at 12:45 PM, Melvin Davidson <melvin6925(at)gmail(dot)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
*http://agency-software.org/ <http://agency-software.org/>*
*https://demo.agency-software.org/client
<https://demo.agency-software.org/client>*
ken(dot)tanzer(at)agency-software(dot)org
(253) 245-3801
Subscribe to the mailing list
<agency-general-request(at)lists(dot)sourceforge(dot)net?body=subscribe> to
learn more about AGENCY or
follow the discussion.
From | Date | Subject | |
---|---|---|---|
Next Message | Berend Tober | 2018-05-19 02:07:06 | Re: When use triggers? |
Previous Message | Melvin Davidson | 2018-05-18 19:45:19 | Re: When use triggers? |