cast from integer to money

Поиск
Список
Период
Сортировка
От Robert Haas
Тема cast from integer to money
Дата
Msg-id AANLkTi=zbyy2=cq8Wa3K3+=n2ynkR1kdTHECnoruWS_G@mail.gmail.com
обсуждение исходный текст
Ответы Re: cast from integer to money  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Список 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 по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Bug in autovacuum.c?
Следующее
От: Peter Eisentraut
Дата:
Сообщение: pg_upgrade exit_nicely()