Re: more problems with the money type
От | Andrew Chernow |
---|---|
Тема | Re: more problems with the money type |
Дата | |
Msg-id | 46CA2B2F.9070003@esilo.com обсуждение исходный текст |
Ответ на | Re: more problems with the money type ("D'Arcy J.M. Cain" <darcy@druid.net>) |
Ответы |
Re: more problems with the money type
Re: more problems with the money type |
Список | pgsql-hackers |
>>> What does "SELECT 2 * '3'::money;" do? That works. >>try changing "64" to "32" in the function cash_mul_int4 That also worked. Datum cash_mul_int4(PG_FUNCTION_ARGS) {Cash c = PG_GETARG_CASH(0);/*int64 i = PG_GETARG_INT64(1);*/ int32 i = PG_GETARG_INT32(1);Cash result; result = c * i;PG_RETURN_CASH(result); } See submitted patch that fixes cash_send and cash_recv as well. Patch: http://archives.postgresql.org/pgsql-patches/2007-08/msg00117.php Andrew D'Arcy J.M. Cain wrote: > On Mon, 20 Aug 2007 17:32:42 -0400 > "Merlin Moncure" <mmoncure@gmail.com> wrote: >> while playing with the binary transport of the money type we found >> another bug. The following code segfaults the server on 8.3cvs: >> >> select '3'::money * 2; > > What does "SELECT 2 * '3'::money;" do? If that works try changing "64" > to "32" in the function cash_mul_int4. Let me know and I will commit > the fix as soon as I get CVS access again. > >> aside: since the money type was deprecated, why was it bumped to 64 bits? > > See the archives. >
В списке pgsql-hackers по дате отправления: