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

From: "Glen Parker" <glenebob(at)nwlink(dot)com>
To: "Pg-General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: ERROR: function round(double precision, integer) does not exist - WTF?
Date: 2004-03-05 03:46:14
Message-ID: 001f01c40264$685e4450$0b01a8c0@saturn
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2004-03-05 04:15:24 Re: ERROR: function round(double precision, integer) does not exist - WTF?
Previous Message Tom Lane 2004-03-05 03:40:11 Re: ERROR: function round(double precision, integer) does