Re: ERROR: function round(double precision, integer) does not exist - WTF? - Mailing list pgsql-general

From Glen Parker
Subject Re: ERROR: function round(double precision, integer) does not exist - WTF?
Date
Msg-id 001f01c40264$685e4450$0b01a8c0@saturn
Whole thread Raw
In response to ERROR: function round(double precision, integer) does not exist - WTF?  ("Glen Parker" <glenebob@nwlink.com>)
Responses Re: ERROR: function round(double precision, integer) does not exist - WTF?
List pgsql-general
> The guideline we've used for implicit coercions is that in
> the numeric type family, only "up conversions" are implicit, that is
> int2->int4->int8->numeric->float4->float8.  "Down conversions" are
> marked as assignment-only.  Without some such restriction,
> there's nothing to keep the parser from making very
> surprising choices of operators.

I was unaware of the details, yes, but your explanation makes perfect sense.
When I say it's broken though, I'm talking more specifically about trying to
use round(float, int); is there some reason that this function overload
should not exist in the absence of an implicit float->numeric cast?
Rounding a floating-point to a specific number of decimal places is a common
enough operation after all...

Glen Parker


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: ERROR: function round(double precision, integer) does
Next
From: Tom Lane
Date:
Subject: Re: ERROR: function round(double precision, integer) does not exist - WTF?