Re: About the MONEY type

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: About the MONEY type
Дата
Msg-id CAHyXU0yaVu--7=UQaRG+vhTRdb884X4j5JQ7C2NBjmdvy1MXjg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: About the MONEY type  (John McKown <john.archie.mckown@gmail.com>)
Список pgsql-general
On Wed, Nov 30, 2016 at 2:16 PM, John McKown
<john.archie.mckown@gmail.com> wrote:
> On Wed, Nov 30, 2016 at 1:23 PM, btober@computer.org
> <btober@broadstripe.net> wrote:
> Speaking generically, I guess maybe MONEY needs to be somewhat like a
> TIMESTAMP. At least in PostgreSQL, a TIMESTAMP can contain a TIMEZONE. I
> guess a MONEY type should contain a modifier identifying the issuer of the
> currency (E.g. U.S. Dollar vs Canadian Dollar vs. Yen vs. Yuan vs. "precious
> metal").

ISTM we already have that functionality; composite types.  Had the
money type been written after we got composite types it might have
been done differently (or perhaps not at all).   A similar observation
can be made against the geometric types.

Proper currency conversion of course is a complex topic; it'd be an
interesting thought experiment to imagine that functionality inside of
a type implementation.

The problem with the money type is that it simultaneously somehow does
too much and not enough.  It kind of lives in twilight as a sneaky
fixed point integer implemented in binary.  It's a scar from the heady
days of youth used to impress people :-).

merlin


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

Предыдущее
От: John McKown
Дата:
Сообщение: Re: About the MONEY type
Следующее
От: John R Pierce
Дата:
Сообщение: Re: About the MONEY type