Re: monetary bug

Поиск
Список
Период
Сортировка
От Oliver Elphick
Тема Re: monetary bug
Дата
Msg-id 1093270766.2020.10.camel@linda
обсуждение исходный текст
Ответ на Re: monetary bug  (Mike Mascari <mascarm@mascari.com>)
Список pgsql-hackers
On Mon, 2004-08-23 at 14:11, Mike Mascari wrote:
...
> MONEY seems "odd" because it is interpreting its internal 
> representation based upon locale and the locale is also determining 
> its possible representation, so one database's MONEY isn't really 
> the same type as another database's MONEY.
> 
> However, Date & Darwen's type model suggests that a database should 
> have support for types like WEIGHT, LENGTH, and TEMPERATURE, 
> although they could certainly be left for the user to define. They 
> define possible representations and THE_ functions as the means to 
> support multiple units (among other purposes.) For example, a LENGTH 
> type would have the following selector functions:
> 
> LENGTH LENGTH_IN_INCHES(NO_OF_INCHES RATIONAL);
> LENGTH LENGTH_IN_FEET(NO_OF_FEET RATIONAL);
> LENGTH LENGTH_IN_CM(NO_OF_CM RATIONAL);

The difference between these and money is that there is a constant
relationship between units; you may measure a distance in inches or
centimetres, but it is always the same distance.  The conversions
between different units of money vary minute by minute.  Furthermore the
unit of money is very important, whereas the unit of length is not.  You
cannot meaningfully add amounts of money in different currencies, even
if you convert to some base currency first.  

-- 
Oliver Elphick                                          olly@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
GPG: 1024D/A54310EA  92C8 39E7 280E 3631 3F0E  1EC0 5664 7A2F A543 10EA
========================================   "For God hath not appointed us to wrath, but to obtain      salvation by our
LordJesus Christ, Who died for us,      that, whether we wake or sleep, we should live       together with him."
                    I Thessalonians 5:9,10 
 



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [PATCHES] ALTER SCHEMA ... SET TABLESPACE
Следующее
От: "Marc G. Fournier"
Дата:
Сообщение: Re: [PATCHES] ALTER SCHEMA ... SET TABLESPACE