postgres development

Roland Roberts roland at astrofoto.org
Thu Mar 6 13:53:04 CST 2003


-----BEGIN PGP SIGNED MESSAGE-----

>>>>> "Andrew" == Andrew Pimlott <gnucash-devel at andrew.pimlott.net> writes:

    Andrew> I expect you can find a way to enforce most of them in the
    Andrew> database, although it may be awkward in SQL, and you would
    Andrew> be duplicating the same constraints in the code.  But how
    Andrew> onerous are these invariants?  Obviously, splits must
    Andrew> balance, and there are probably (?) some limitations on
    Andrew> which kinds of splits can go in which kinds of accounts.
    Andrew> Am I missing a lot?

I can't answer you final question, but the constraints can be managed
in PostgreSQL via triggers.  I have added similar trigger-based
constraints to recalculate certain columns values based on other
columns' values.  The use of triggers will prevent the use of less
feature-complete databases, but the major RDBMS products will all have
triggers and stored procedures (although every one of them will be
different).

However, how much of that do you really want to push into the
database?  Right now, the XML file doesn't enforce any
constraints/invariants; that's done by the front-end and the back-end
is "merely" a storage container.  Pushing the constraints into the
backend makes it possible to maintain consistency even with a badly
written alternate front-end application, but is that something you
want to worry about?  If it is, then triggers will do the trick.

regards,

roland
- -- 
		       PGP Key ID: 66 BC 3B CD
Roland B. Roberts, PhD                             RL Enterprises
roland at rlenter.com                            6818 Madeline Court
roland at astrofoto.org                           Brooklyn, NY 11220

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3ia
Charset: noconv
Comment: Processed by Mailcrypt 3.5.4, an Emacs/PGP interface

iQCVAwUBPmeZEOoW38lmvDvNAQEkpQP8CWTL2lTqZlp0vKyhZjdb14s0LIXTKtVn
Aorn/J+YFquXMpKTIR2fqbLx1KhLq5qXbZJxuvzOiXaWXJN6PDGn12TS6H2Kl/sr
O3M7Mk1fwZMmt+tzkLfe7BehLDHck25Tn2NQIcw6L6M7DQoclfypLYBx8evj7iND
fTlEWj+dZ6g=
=q2zk
-----END PGP SIGNATURE-----


More information about the gnucash-devel mailing list