Skip site navigation (1) Skip section navigation (2)

cast from integer to money

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: cast from integer to money
Date: 2011-03-31 20:27:54
Message-ID: AANLkTi=zbyy2=cq8Wa3K3+=n2ynkR1kdTHECnoruWS_G@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On the open items list, we have:

conversion from integer literals to money type
http://archives.postgresql.org/pgsql-testers/2011-01/msg00000.php

What this is really complaining about is that we added a cast from
numeric to money, but not from integer to money.  This isn't really a
bug: the fact that we added one cast doesn't oblige us to add two.  On
the other hand, the change is probably harmless and straightforward,
and might reduce user confusion.  Right now:

rhaas=# select 1::money;
ERROR:  cannot cast type integer to money
LINE 1: select 1::money;
                ^
rhaas=# select 1.0::money;
 money
-------
 $1.00
(1 row)

Does anyone care enough about this to put in the effort to fix it, or
should we just let it go?  Does anyone see a reason why we wouldn't
want to do this, if someone's motivated to code it up?

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Responses

pgsql-hackers by date

Next:From: Peter EisentrautDate: 2011-03-31 20:31:33
Subject: pg_upgrade exit_nicely()
Previous:From: Robert HaasDate: 2011-03-31 20:21:50
Subject: Re: Bug in autovacuum.c?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group