Re: View vs Constantly Updated Table

From: "marcin mank" <marcin(dot)mank(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: View vs Constantly Updated Table
Date: 2008-12-16 20:16:04
Message-ID: b1b9fac60812161216q7c695bb7kc57d6f16d9b23f21@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andreas Kretschmer 2008-12-16 20:18:54 Re: Isolating a record column from a PL-Pgsql function call ?
Previous Message Madison Kelly 2008-12-16 20:15:44 Re: TIMESTAMP with a timezone offset