Re: Fixes for MONEY type using locale

From: "D'Arcy J(dot)M(dot) Cain" <darcy(at)druid(dot)net>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Fixes for MONEY type using locale
Date: 2007-11-24 17:14:15
Message-ID: 20071124121415.935859ca.darcy@druid.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Sat, 24 Nov 2007 11:27:38 -0500 (EST)
Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> I am confused about two other items with MONEY. First, why can't
> anything but a string be cast to this type?
>
> test=> select 871234872319489323::money;
> ERROR: cannot cast type bigint to money
> LINE 1: select 871234872319489323::money;
> ^
> test=> select 871234872::money;
> ERROR: cannot cast type integer to money
> LINE 1: select 871234872::money;
> ^
> test=> select 87123487231.3::money;
> ERROR: cannot cast type numeric to money
> LINE 1: select 87123487231.3::money;
> ^

I agree. I wasn't the one that added the meta information.

> And second, why are there no regression tests for MONEY. I see it used
> only once in the rules test.

I think that scrappy added this into the code before we were so
vigorous about creating regression tests for everything. I agree that
there should be something. I personally unit test all my own code and
I am a big test booster.

I will look at adding something in.

--
D'Arcy J.M. Cain <darcy(at)druid(dot)net> | Democracy is three wolves
http://www.druid.net/darcy/ | and a sheep voting on
+1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2007-11-24 17:45:40 Re: Problem with pg_dump -n schemaname
Previous Message Gregory Stark 2007-11-24 16:50:22 Re: 8.3devel slower than 8.2 under read-only load

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2007-11-24 17:45:40 Re: Problem with pg_dump -n schemaname
Previous Message Bruce Momjian 2007-11-24 16:27:38 Re: Fixes for MONEY type using locale