Re: monetary bug

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Mike Mascari <mascarm(at)mascari(dot)com>, Mahmoud Taghizadeh <m_taghi(at)yahoo(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: monetary bug
Date: 2004-08-22 20:34:07
Message-ID: 200408222234.07650.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message D'Arcy J.M. Cain 2004-08-22 21:15:11 Re: monetary bug
Previous Message Tom Lane 2004-08-22 20:16:23 Re: monetary bug