cast from integer to money - Mailing list pgsql-hackers

From Robert Haas
Subject cast from integer to money
Date
Msg-id AANLkTi=zbyy2=cq8Wa3K3+=n2ynkR1kdTHECnoruWS_G@mail.gmail.com
Whole thread Raw
Responses Re: cast from integer to money
List 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


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Bug in autovacuum.c?
Next
From: Peter Eisentraut
Date:
Subject: pg_upgrade exit_nicely()