Re: cast from integer to money
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Joseph Adams <joeyadams3.14159@gmail.com>, Stephen Frost <sfrost@snowman.net>, Kevin Grittner <Kevin.Grittner@wicourts.gov>, pgsql-hackers@postgresql.org
Date: 2011-04-04T03:33:56Z
Lists: pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes: > On Fri, Apr 1, 2011 at 10:33 PM, Joseph Adams > <joeyadams3.14159@gmail.com> wrote: >> The only other numeric types (other than oid, cardinal_number, >> etc.) that can't be casted directly to money are float4 and float8, >> and I suspect this is intentional. > Agreed. BTW, I think inclusion of int2 in this patch is just a waste of code space. The main argument for supporting these casts seems to be that integer literals produced by the parser should be castable to money without special pushups. But the parser never produces native int2 constants. So int4 and int8 will cover all the useful cases. regards, tom lane