Re: cast from integer to money - Mailing list pgsql-hackers

From Kevin Grittner
Subject Re: cast from integer to money
Date
Msg-id 4D94A4A6020000250003C043@gw.wicourts.gov
Whole thread Raw
In response to cast from integer to money  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: cast from integer to money
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> wrote:
> On the open items list, we have:
> 
> conversion from integer literals to money type
> http://archives.postgresql.org/pgsql-testers/2011-01/msg00000.php
> 
> What this is really complaining about is that we added a cast from
> numeric to money, but not from integer to money.  This isn't
> really a bug: the fact that we added one cast doesn't oblige us to
> add two. On the other hand, the change is probably harmless and
> straightforward, and might reduce user confusion.
There were reasonable arguments made why this could be a bad idea --
primarily around the question of whether '395' represented $3.95 or
$395.00.  Going the other way has issues with truncation of
fractions and the number of digits which can be handled.  I'm not
convinced it's sane, and I feel strongly it's too late in the cycle
to try to implement.
-Kevin


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: pg_upgrade exit_nicely()
Next
From: Alexey Klyukin
Date:
Subject: Re: proposal: a validator for configuration files