[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
From:       "Glen Parker" <glenebob () nwlink ! com>
Date:       2004-03-05 2:12:36
Message-ID: 000f01c40257$53df7420$0b01a8c0 () saturn
[Download RAW message or body]

> 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


---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

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

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