Re: numeric and float comparison oddities - Mailing list pgsql-hackers

From Tom Lane
Subject Re: numeric and float comparison oddities
Date
Msg-id 1771.1406921230@sss.pgh.pa.us
Whole thread Raw
In response to Re: numeric and float comparison oddities  (Kevin Grittner <kgrittn@ymail.com>)
Responses Re: numeric and float comparison oddities
List pgsql-hackers
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.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Kevin Grittner
Date:
Subject: Re: numeric and float comparison oddities
Next
From: Kevin Grittner
Date:
Subject: Re: numeric and float comparison oddities