Re: About the MONEY type - Mailing list pgsql-general

From Merlin Moncure
Subject Re: About the MONEY type
Date
Msg-id CAHyXU0yaVu--7=UQaRG+vhTRdb884X4j5JQ7C2NBjmdvy1MXjg@mail.gmail.com
Whole thread Raw
In response to Re: About the MONEY type  (John McKown <john.archie.mckown@gmail.com>)
List 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 by date:

Previous
From: John McKown
Date:
Subject: Re: About the MONEY type
Next
From: John R Pierce
Date:
Subject: Re: About the MONEY type