Re: SQL for CREATE RULE - Mailing list pgsql-general

From Alessio Bragadini
Subject Re: SQL for CREATE RULE
Date
Msg-id 3B52F3C0.AF1B561A@albourne.com
Whole thread Raw
In response to SQL for CREATE RULE  (Bryan Buchanan <bryanb@webbtide.com.au>)
List pgsql-general
Bryan Buchanan wrote:

> I have two tables:
>
> journal_master (serial #, account, date, debit $, credit $)
> journal_summary (account, date, debit $, credit $)
>
> each time a transaction occurs, a new journal_master row is
> added, and the cumulative amounts added to the summary table.

You don't need a RULE but a TRIGGER. Check out PostgreSQL's
documentation.

Yes, it's possible and it's similar to your solution.

--
Alessio F. Bragadini        alessio@albourne.com
APL Financial Services        http://village.albourne.com
Nicosia, Cyprus             phone: +357-2-755750

"It is more complicated than you think"
        -- The Eighth Networking Truth from RFC 1925

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: slow line insert
Next
From: Bruce Momjian
Date:
Subject: Auguest Linux Journal