Re: ERROR: function round(double precision, integer) does

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
Date: 2004-03-05 02:12:36
Message-ID: 000f01c40257$53df7420$0b01a8c0@saturn
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> From: pgsql-general-owner(at)postgresql(dot)org
> [mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of
> Joshua D. Drake
>
> > oms=# select round(1.25::decimal, 2);
> > round
> > -------
> > 1.25
> > (1 row)
> >
> > BUT.............
> >
> > DB=# select round(1.25::float, 2);
>
>
> select round(1.25::numeric, 2);

Yeah I know, but in the interest of portability, I have to use the full-on
SQL cast (cast(1234.123 as numeric)). Besides, I'd have to fix (for lack of
a better word) piles of queries.

This popped up because we're doing dev work against a 7.4 server but
deploying against a 7.2 server. To make matters worse, here's one of the
errors we get on 7.2 after doing the casts and re-deploying:

DB=# select 1234::numeric > 1234::float;
ERROR: Unable to identify an operator '>' for types 'numeric' and 'double
precision'
You will have to retype this query using an explicit cast

Again, WTF??? Since this is on 7.2 (and fixed on >= 7.3), I'm not too
worried about it, but it, too, is quite broken.

The result is that development work is suddenly a big pain in the a$$ where
these queries are concerned. I'm considering Postgres to be broken. Am I
wrong? Is there an actual reason for this behavior?

Thx again,
Glen Parker
glenebob(at)nwlink(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2004-03-05 02:18:23 Re: ERROR: function round(double precision, integer) does not exist - WTF?
Previous Message Michael Chaney 2004-03-05 02:10:37 Re: Moving from MySQL to PGSQL....some questions (multilevel