Re: Money casting too liberal?

Поиск
Список
Период
Сортировка
От Gavan Schneider
Тема Re: Money casting too liberal?
Дата
Msg-id 30509-1364605462-703153@sneakemail.com
обсуждение исходный текст
Ответ на Re: Money casting too liberal?  (Gavan Schneider <pg-gts@snkmail.com>)
Ответы Re: Money casting too liberal?  ("D'Arcy J.M. Cain" <darcy@druid.net>)
Список 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 по дате отправления:

Предыдущее
От: Jeff Davis
Дата:
Сообщение: Re: Money casting too liberal?
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Regular function