[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-general
Subject:    Re: [GENERAL] ERROR: function round(double precision, integer) does not exist - WTF?
From:       "Glen Parker" <glenebob () nwlink ! com>
Date:       2004-03-05 3:46:14
Message-ID: 001f01c40264$685e4450$0b01a8c0 () saturn
[Download RAW message or body]

> 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


---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
      joining column's datatypes do not match

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic