Re: [PATCHES] [PATCH] Contrib C source for casting MONEY to INT[248] and FLOAT[48]

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [PATCHES] [PATCH] Contrib C source for casting MONEY to INT[248] and FLOAT[48]
Дата
Msg-id 22666.992960418@sss.pgh.pa.us
обсуждение исходный текст
Ответы Re: [PATCHES] [PATCH] Contrib C source for casting MONEY to INT[248] and FLOAT[48]  ("David D. Kilzer" <ddkilzer@lubricants-oil.com>)
Список pgsql-hackers
"David D. Kilzer" <ddkilzer@lubricants-oil.com> writes:
> Attached please find a patch to cast (convert) the MONEY type to any one
> of the following types:
>   INT2, INT4, INT8, FLOAT4, FLOAT8

Hmm.  It strikes me as a rather bad idea to introduce implicit casting
of MONEY to all these other types --- I suspect that's going to create
a bunch of parsing ambiguities.

> I wrote this because I needed to convert MONEY to a standard decimal
> value and didn't want to do it on the client in Perl, and I didn't want
> to use a plpgsql function that used string parsing.

Seems like a better answer is to use NUMERIC instead of MONEY in the
first place...

            regards, tom lane

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Re: temp-table-related failure in regression tests
Следующее
От: Alex Pilosov
Дата:
Сообщение: Re: PlPerl compile failure