Re: Fixes for MONEY type using locale - Mailing list pgsql-patches

From D'Arcy J.M. Cain
Subject Re: Fixes for MONEY type using locale
Date
Msg-id 20071124121415.935859ca.darcy@druid.net
Whole thread Raw
In response to Re: Fixes for MONEY type using locale  (Bruce Momjian <bruce@momjian.us>)
List pgsql-patches
On Sat, 24 Nov 2007 11:27:38 -0500 (EST)
Bruce Momjian <bruce@momjian.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@druid.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.

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Fixes for MONEY type using locale
Next
From: Bruce Momjian
Date:
Subject: Re: Problem with pg_dump -n schemaname