Re: [HACKERS] Fixes for MONEY type using locale

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, "D'Arcy J(dot)M(dot) Cain" <darcy(at)druid(dot)net>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] Fixes for MONEY type using locale
Date: 2007-11-27 05:50:24
Message-ID: 200711270550.lAR5oOv28603@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:
> "Joshua D. Drake" <jd(at)commandprompt(dot)com> writes:
> > Well if we are going to continue to support money (which I am against)
> > we should support the casting to numeric as that is by far a more
> > common implementation of money and we will have mixed environments.
>
> So, you don't use MONEY, and you don't want to, but nonetheless you
> know better than the people who do use MONEY what they need.
>
> Aside from the semantic-gap issue, there is the point that providing
> a cast might actually mask application errors. I can well imagine
> cases where one of the reasons for using MONEY is *exactly* that it's
> not a plain number or easily convertible to one.

Right. I am not thinking of an auto-cast but rather give people _some_
way to cast to/from MONEY, which is what the TODO says:

* Allow MONEY to be cast to/from other numeric data types

Even when we have multiple currency designations I would think people
would need a way to cast. I am trying to anticpate how MONEY will be
used. You are right we don't have any field requests yet, but I am
expecting them.

I have added documentation on the issues of casting to/from MONEY;
patch attached and applied.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://postgres.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

Attachment Content-Type Size
/rtmp/diff text/x-diff 960 bytes

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paesold 2007-11-27 07:20:43 Re: [PATCHES] Proposed patch for operator lookup caching
Previous Message Bruce Momjian 2007-11-27 05:34:42 Re: [PATCHES] Proposed patch for operator lookup caching

Browse pgsql-patches by date

  From Date Subject
Next Message Michael Paesold 2007-11-27 07:20:43 Re: [PATCHES] Proposed patch for operator lookup caching
Previous Message Bruce Momjian 2007-11-27 05:34:42 Re: [PATCHES] Proposed patch for operator lookup caching