Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Kevin Grittner <kgrittn@ymail.com> writes:
>> It would be more consistent, ISTM, to cast
>> float8 to float4 when those are compared, and to cast numeric to
>> whichever type is on the other side of the comparison operator.
>
> I would vote against that on the grounds of greatly increased risk
> of overflow failure. Admittedly, numeric->float8 can also fail,
> but float4 only goes to 1e37 or thereabouts.
Since 1e28 is sufficient to measure the diameter of the universe in
angstroms, I'm not sure I accept the adjective "greatly" there. I
suspect that people are getting silently burned by current behavior
more often than they would get overflow errors with the change. At
least when you get an error it's pretty clear how to fix it with a
cast.
--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company