Re: Application using PostgreSQL as a back end (experienced programmers please)

From: Chris Browne <cbbrowne(at)acm(dot)org>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Application using PostgreSQL as a back end (experienced programmers please)
Date: 2005-11-15 17:12:24
Message-ID: 60br0lj0nb.fsf@dba2.int.libertyrms.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Christopher Browne <cbbrowne(at)acm(dot)org> writes:
>> I expect the income tax program to be computationally intensive but
>> I also expect most of this computation to take place in PostgreSQL
>> and not the front end.
>
> I disagree, and I have some history with this variety of application
> ;-).
>
> My personal tax calculator is an application I wrote in Prolog. The
> "base data" is a surprisingly compact set of Prolog rules.
> <http://sourceforge.net/projects/prologtaxes/>
>
> What is really vital in the application is how you store the rules for
> expressing the interrelation between fields. What you're sure to need
> to do is to draw the data out in order to do the calculations. I'd
> fully expect you to have some sort of "calculation engine" where the
> calculations get done. This may seem surprising, but I really think
> it won't take place inside the database.

Actually, this merits a bit more explanation...

The thing that made Prolog desirable, to me, for this application, and
which seems to me to make the database engine likely unsuitable is the
whole issue of "ordering of calculations."

In Prolog, I didn't have to say *anything* about what order the
various tax rules needed to be applied in order to calculate the final
results.

You'll find that expressly applying the logic to do all of the
calculations in proper order will be one of the irritating parts of
the application.

Doing the calculations inside the database engine would mandate doing
some fancy SQL indeed in order to ensure that:
a) All calculations are done in the right order
b) You have all of the interim balances presented to you...

This is essentially the same problem as that which spreadsheets have
in determining the "graph" of dependancies of one cell against
another...
--
(format nil "~S(at)~S" "cbbrowne" "ntlug.org")
http://www.ntlug.org/~cbbrowne/spreadsheets.html
How does the guy who drives the snowplow get to work in the mornings?

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Lane Van Ingen 2005-11-15 21:42:50 Difficulties Storing Case Sensitive DDL Definitions
Previous Message A. Kretschmer 2005-11-15 16:52:36 Re: connecting to linux server from windows xp