Re: View vs Constantly Updated Table - Mailing list pgsql-general

From marcin mank
Subject Re: View vs Constantly Updated Table
Date
Msg-id b1b9fac60812161216q7c695bb7kc57d6f16d9b23f21@mail.gmail.com
Whole thread Raw
In response to View vs Constantly Updated Table  (Ketema Harris <ketema@ketema.net>)
List pgsql-general
It is generally better to save the balance. The general rule in
accounting systems design is "what can be printed, should be
explicitly on disk". for an invoice:

value before tax, tax percentage, value after tax, total before tax,
total after tax, etc, should all be saved explicitly.

An account should have a balance. Every operation should have balance
before operation, value, balance after operation. You should never
update an operation.

This way when business rules change all previous documents are stored
in consistent state.

Greetings
Marcin Mańk

pgsql-general by date:

Previous
From: Madison Kelly
Date:
Subject: Re: TIMESTAMP with a timezone offset
Next
From: Andreas Kretschmer
Date:
Subject: Re: Isolating a record column from a PL-Pgsql function call ?