Function round(double precision, integer) does not exists trouble in 7.3.1, did work on 7.2.1 - Mailing list pgsql-bugs

From Felipe Barousse Boué
Subject Function round(double precision, integer) does not exists trouble in 7.3.1, did work on 7.2.1
Date
Msg-id 1041710292.2020.85.camel@monster.piensa.com
Whole thread Raw
Responses Re: Function round(double precision, integer) - Fast backward compatibility solution  (Silvio Scarpati <silvio.scarpati@virgilio.it>)
List pgsql-bugs
I am having trouble with a function round that used to work in 7.2.1

PostgreSQL was updated to 7.3.1 from 7.2.1, the data was re-loaded into
7.3.1 with no complaints from the DB engine but, at application run
time, we do get the error:

Function round(double precision, integer) does not exists

Code executed and that worked fine in 7.2.1 is:

selectclientes.id_cliente,clientes.codigo_cliente,clientes.total,clientes.deuda,clientes_pagos,total_pagos,
diferencia      from 
(
select clientes.id_cliente,clientes.codigo_cliente,clientes.total,clientes.deuda,(clientes.total-clientes.deuda) as
clientes_pagos,sum(sum)as total_pagos,       round((clientes.total-clientes.deuda)-sum(sum),4) as diferencia from    (
 select         codigo_cliente,         sum(total_pago)         from pagos        where estatus!='C'        group by
codigo_cliente 
    union    select         codigo_cliente,         sum(total_nota)        from notas_credito        where estatus!='C'
      group by codigo_cliente    )     as TT 
where codigo_cliente=clientes.codigo_clientegroup by
clientes.codigo_cliente,clientes.id_cliente,clientes.total,clientes.deuda,clientes_pagos
)
as TT1
where diferencia>0;


Question is, what changed in 7.3.1 in reference to the round function.

Tom Lane stated in a previous post (attached below) that "There isn't a
round(double, integer) function in 7.3 and there wasn't one in 7.2
either."    I am not so sure that is the case in our installation.

¿ How it can be explained then that it worked fine in a stock install
(rpm from RedHat Linux 7.3) of PostgreSQL 7.2.1 ?

Are we missing something here...?

Any comments or sugestions are welcome.

Felipe Barousse



> From: pgsql-bugs@postgresql.org
> To: pgsql-bugs@postgresql.org
> Subject: Bug #835: round(double precision,integer) function in 7.3 does not work
> Date: Wed, 4 Dec 2002 16:26:28 -0500 (EST)
>
>
> Eugene von Niederhausern (evonnied@niederworks.com) reports a bug with a severity of 3
> The lower the number the more severe it is.
>
> Short Description
> round(double precision,integer)  function in 7.3 does not work
>
> Long Description
> round(double precision,integer) does not work with 7.3. This function did work with 7.2.x.
>
> Sample Code
> select round((extract(epoch from CURRENT_TIMESTAMP) - extract(epoch from '2002-12-01'::timestamp))/60.0/60.0/24.0,2);
/**does not work with 7.3 **/ 
>
> select round((extract(epoch from CURRENT_TIMESTAMP) - extract(epoch from '2002-12-01'::timestamp))/60.0/60.0/24.0);
/**does work with 7.3 **/ 
>
> select round(((extract(epoch from CURRENT_TIMESTAMP) - extract(epoch from
'2002-12-01'::timestamp))/60.0/60.0/24.0)::numeric,2);/** does work with 7.3 **/ 
>
> No file was uploaded with this report
>
>
>
> From: Tom Lane <tgl@sss.pgh.pa.us>
> To: evonnied@niederworks.com, pgsql-bugs@postgresql.org
> Subject: Re: Bug #835: round(double precision,integer) function in 7.3 does not work
> Date: Wed, 04 Dec 2002 17:55:29 -0500
>
>
> > round(double precision,integer)  function in 7.3 does not work
>
> There isn't a round(double, integer) function in 7.3, and there wasn't
> one in 7.2 either.
>
> 7.3 forces you to write the cast to numeric explicitly.
>
> regards,

pgsql-bugs by date:

Previous
From: Sean Chittenden
Date:
Subject: Re: dropping user doesn't erase his rights.
Next
From: "Sverre H. Huseby"
Date:
Subject: Re: Bug #864: MOD(RANDOM(),1.0) don't work in 7.3.1