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: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
On the open items list, we have:

conversion from integer literals to money type

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;
(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
The Enterprise PostgreSQL Company


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-2017 The PostgreSQL Global Development Group