Search Postgresql Archives

Re: Money casting too liberal?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux