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

From Glen Parker
Subject Re: ERROR: function round(double precision, integer) does
Date
Msg-id 000f01c40257$53df7420$0b01a8c0@saturn
Whole thread Raw
In response to Re: ERROR: function round(double precision, integer) does  ("Joshua D. Drake" <jd@commandprompt.com>)
Responses Re: ERROR: function round(double precision, integer) does
Re: ERROR: function round(double precision, integer) does
List pgsql-general
> From: pgsql-general-owner@postgresql.org
> [mailto:pgsql-general-owner@postgresql.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@nwlink.com


pgsql-general by date:

Previous
From: Michael Chaney
Date:
Subject: Re: Moving from MySQL to PGSQL....some questions (multilevel
Next
From: Tom Lane
Date:
Subject: Re: ERROR: function round(double precision, integer) does not exist - WTF?