Re: Money casting too liberal?

From: Gavan Schneider <pg-gts(at)snkmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Money casting too liberal?
Date: 2013-03-30 01:04:21
Message-ID: 30509-1364605462-703153@sneakemail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 30/3/13 at 9:30 AM, I wrote:

>I have sketched something of a notation for MONEY columns along these lines:
>
>amt_received MONEY ( CURRENCY -- e.g., 'USD' 'AUD' 'YEN' ...
>[,SCALE -- default as per currency, e.g. USD 2 decimals
>-- but could be used to see money in bigger units
>-- such as '000s (e.g., that end-of-month view)
>[,ROUND -- need to allow for multiple rules here, sometimes
>-- cents are just dropped, otherwise it can be
>-- required that rounding is up or down
>[,OTHER?
>]]])
>
Addition...

No MONEY column would be complete without the ability to specify
whether it is normally DEBIT or CREDIT (or in my preferred case
NATURAL, i.e., no sign is pre-applied before any arithmetic
between columns).

This is possibly the best use case for the type since it really
allows for the DB/CR (IMNSHO arcane) conventions to be properly
handled within established industry traditions and has special
benefits with externally provided data... values will enter the
dB with sign conventions properly observed.

Regards
Gavan Schneider

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Paquier 2013-03-30 01:50:27 Re: Regular function
Previous Message Jeff Davis 2013-03-30 00:23:50 Re: Money casting too liberal?