Re: Money casting too liberal? - Mailing list pgsql-general

From Gavan Schneider
Subject Re: Money casting too liberal?
Date
Msg-id 30509-1364605462-703153@sneakemail.com
Whole thread Raw
In response to Re: Money casting too liberal?  (Gavan Schneider <pg-gts@snkmail.com>)
Responses Re: Money casting too liberal?
List 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



pgsql-general by date:

Previous
From: Jeff Davis
Date:
Subject: Re: Money casting too liberal?
Next
From: Michael Paquier
Date:
Subject: Re: Regular function