Re: [HACKERS] money or dollar type - Mailing list pgsql-hackers

From Thomas G. Lockhart
Subject Re: [HACKERS] money or dollar type
Date
Msg-id 355850DF.BC133F00@alumni.caltech.edu
Whole thread Raw
In response to Re: [HACKERS] money or dollar type  ("Jose' Soares Da Silva" <sferac@bo.nettuno.it>)
List pgsql-hackers
> Seems there's some problems with type 'money'... I can't multiply or
> divide 'money' types, and can't cast it properly to other data types.
> Is this a bug ?

With the new type conversion code:

tgl=> create table mm (m money);
CREATE
tgl=> insert into mm values ('$1600.00');
INSERT 268105 1
tgl=> select m * 1.1 from mm;
?column?
---------
$1,760.00
(1 row)

But,

tgl=> select cast(m as float8) from mm;
    float8
----------
1077124288
(1 row)

So there is some funny interaction on the casting, the same as you found
in v6.3.2 (and presumably forever), which I will look into...

                     - Tom

pgsql-hackers by date:

Previous
From: Andreas Zeugswetter
Date:
Subject: AW: [HACKERS] questionable codes in libpq/backend communication
Next
From: "Andy Farrell"
Date:
Subject: Box operation algorithms