Re: dividing money by money

Поиск
Список
Период
Сортировка
От Boszormenyi Zoltan
Тема Re: dividing money by money
Дата
Msg-id 4BB1B1BE.1040603@cybertec.at
обсуждение исходный текст
Ответ на Re: dividing money by money  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Ответы Re: dividing money by money
Re: dividing money by money
Список pgsql-bugs
Kevin Grittner írta:
> Andy Balholm  wrote:
>
>
>> The ability to divide money by money would be useful for finding
>> what percent one money value is of another.
>>
>
> That certainly sounds useful and natural to me.  I don't think it
> rises to the level of a *bug*, but it's a reasonable request for
> enhancement.  If there are no objections I'll add it to the TODO
> list.
>

How about improving the money type so it can store
values in different currencies?

=# create table money1 (x money);
CREATE TABLE
=# insert into money1 values ('1');
INSERT 0 1
=# select * from money1;
   x
--------
 Ft1,00
(1 sor)

=# insert into money1 values ('$1');
ERROR:  invalid input syntax for type money: "$1"

pg_dump -t money1:

==================
Ft1,00
\.
==================

Loading this dump into another database that happens
to have a different locale than hu_HU fails.

But then any operator between two money values would
only work if both values have the same currency.

Best regards,
Zoltán Böszörményi

--
Bible has answers for everything. Proof:
"But let your communication be, Yea, yea; Nay, nay: for whatsoever is more
than these cometh of evil." (Matthew 5:37) - basics of digital technology.
"May your kingdom come" - superficial description of plate tectonics

----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
http://www.postgresql.at/

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

Предыдущее
От: Jasen Betts
Дата:
Сообщение: Re: dividing money by money
Следующее
От: John R Pierce
Дата:
Сообщение: Re: dividing money by money