Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-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: /rtmp/diff
Description: text/x-diff (960 bytes)

In response to

pgsql-hackers by date

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

pgsql-patches by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group