3 ms·
> The inconsistencies in question relate to the domain model of accounting, not referential integrity or other (normally) easily enforced database invariants.
by jimktrains2 7y ago
> The inconsistencies in question relate to the domain model of accounting, not referential integrity or other (normally) easily enforced database invariants.
Constraints can be more than referential integrity. When PostgreSQL released transition tables, I built a very small proof-of-concept using them to constrain a double-entry (-like) system. https://github.com/jimktrains/pgdea https://github.com/jimktrains/pgdea allows any number of debits and credits in a transaction, but the whole transaction must have a 0 balance.