pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: D'Arcy J.M. Cain <darcy@druid.net>
To: Thomas Good <tomg@sqlclinic.net>
To: Postgres SQL List <pgsql-sql@postgreSQL.org>
Subject: Re: Casting Money To Numeric
Date: Wed, 27 Nov 2002 07:51:57 -0500
Message-ID: <20021127125157.E5DE11AFD@druid.net> (raw)
In-Reply-To: <Pine.LNX.4.33.0211261415350.16043-100000@q8.nrnet.org>
References: <Pine.LNX.4.33.0211261415350.16043-100000@q8.nrnet.org>

On November 26, 2002 02:19 pm, Thomas Good wrote:
> Having perused all the online docs I can find it appears there is no
> SQL solution for casting the dread money type to numeric.
> Is this true?
>
> select rent::numeric(9,2) from x;
> ERROR: Cannot cast type 'money' to 'numeric'

Fraid so.  That's one of the reasons that I had to finally leave that type 
for numeric.  Be prepared, however, for SUM() to take longer on groups of any 
significant size.  That's the one thing that was really nice about money - 
everything was integer arithmetic.

-- 
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 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.



view thread (2+ messages)

Message-ID: <20021127125157.E5DE11AFD@druid.net>
Permalink:  ../20021127125157.E5DE11AFD@druid.net/
Also on:    postgresql.org/message-id/20021127125157.E5DE11AFD@druid.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: darcy@druid.net, tomg@sqlclinic.net
  Subject: Re: Casting Money To Numeric
  In-Reply-To: <20021127125157.E5DE11AFD@druid.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox