Re: Debet-Credit-Balance Calculation

From: Chris Browne <cbbrowne(at)acm(dot)org>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Debet-Credit-Balance Calculation
Date: 2005-04-20 13:43:05
Message-ID: 60ll7d36om.fsf@dba2.int.libertyrms.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

middink(at)indo(dot)net(dot)id ("Muhyiddin A.M Hayat") writes:
>> There is an easy way to do this; write a plpgsql set returning
>> function which adds the balance to the last column of the table. That
>> query will always have a cost in both time and memory proportional to
>> the size of the table, and the memory cost may bite you as table size
>> grows...
>> --
>
> Can you give me some example function which adds the balance to the
> last column of the table.
>
> Thanks.

No time, but here is a link to a useful article on SRFs.

<http://techdocs.postgresql.org/guides/SetReturningFunctions>

Once you know how to do an SRF, you should be able to build the one
you need.
--
(format nil "~S(at)~S" "cbbrowne" "acm.org")
http://www.ntlug.org/~cbbrowne/sap.html
Rules of the Evil Overlord #78. "I will not tell my Legions of Terror
"And he must be taken alive!" The command will be: ``And try to take
him alive if it is reasonably practical.''"
<http://www.eviloverlord.com/>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Marinos Yannikos 2005-04-20 15:23:06 Odd error message (" hash indexes do not support whole-index scans")
Previous Message Muhyiddin A.M Hayat 2005-04-20 12:55:33 Re: Debet-Credit-Balance Calculation