Re: monetary bug

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: monetary bug
Дата
Msg-id 200408222234.07650.peter_e@gmx.net
обсуждение исходный текст
Ответ на Re: monetary bug  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: monetary bug  (Dennis Bjorklund <db@zigo.dhs.org>)
Список pgsql-hackers
Tom Lane wrote:
> The idea behind the money type is to format per the lc_monetary
> locale setting, which seems perfectly reasonable to me.

To me, this seems completely wrong-headed.  Data types should be defined 
by what operations you can do on them, not by what output format they 
have.  With that in mind, a money type that is separate from numeric 
types could be reasonable, because not all mathematical operations are 
reasonable on monetary amounts.  But most well-designed client 
interfaces nowadays reparse the text representations of data to present 
the datum in terms of the client's own data type system, so a money 
type with a varying and unpredictable output format cannot be 
reasonably supported and will only create headaches.  And even those 
client interfaces that don't fall into that category will have trouble, 
because for example you could have trouble sorting the values 
numerically.  So again, if you're looking for a certain display form, 
use the functions that were made for that purpose.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: monetary bug
Следующее
От: "D'Arcy J.M. Cain"
Дата:
Сообщение: Re: monetary bug