Re: [HACKERS] money data type and conversions - Mailing list pgsql-hackers

From D'Arcy" "J.M." Cain
Subject Re: [HACKERS] money data type and conversions
Date
Msg-id m10wsd8-0000bFC@druid.net
Whole thread Raw
In response to Re: [HACKERS] money data type and conversions  (Bruce Momjian <maillist@candle.pha.pa.us>)
Responses Re: [HACKERS] money data type and conversions]
List pgsql-hackers
Thus spake Bruce Momjian
> > Well, can't explain the why's...
> > 
> > But I have the code to add to cash.c and cash.h to add the conversion 
> > functions, but still have to figure out how to get PostgreSQL to recognize 
> > it...   Guessing... it's in fmgrtab.c right?
> > 
> 
> Duane, sonds like people want to remove the Money/cash type and transfer
> everyone over to decimal which has full precision and is much better for
> currency.

Is there any reason why we don't just leave money in?  I know that NUMERIC
and DECIMAL will handle money amounts but the money type does a few
extra things related to locale, even if we remove the currency symbol
and perhaps we should leave that in if people are expected to use the
new types.  It also determines whether the comma or period is the correct
separator, puts separators in the correct place and determines where the
decimal point goes.  Also, check out what the following does.
   select cash_words_out('157.23');

Althugh there appears to be a bug in that function that chops the last
character from the output.

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


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] The dangers of "-F"
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] money data type and conversions]