Search Postgresql Archives

Re: About the MONEY type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 30, 2016 at 2:16 PM, John McKown
<john.archie.mckown@xxxxxxxxx> wrote:
> On Wed, Nov 30, 2016 at 1:23 PM, btober@xxxxxxxxxxxx
> <btober@xxxxxxxxxxxxxxx> 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


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux