Function round(double precision, integer) does not exists trouble in 7.3.1, did work on 7.2.1

From: Felipe Barousse Boué <fbarousse(at)piensa(dot)com>
To: tgl(at)sss(dot)pgh(dot)pa(dot)us, evonnied(at)niederworks(dot)com, pgsql-bugs(at)postgresql(dot)org
Subject: Function round(double precision, integer) does not exists trouble in 7.3.1, did work on 7.2.1
Date: 2003-01-04 19:58:13
Message-ID: 1041710292.2020.85.camel@monster.piensa.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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:

select
clientes.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_cliente
group 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(at)postgresql(dot)org
> To: pgsql-bugs(at)postgresql(dot)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(at)niederworks(dot)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(at)sss(dot)pgh(dot)pa(dot)us>
> To: evonnied(at)niederworks(dot)com, pgsql-bugs(at)postgresql(dot)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,

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2003-01-04 22:13:13 Re: Table Inherit Problem
Previous Message pgsql-bugs 2003-01-04 16:45:02 Bug #863: pg_dump segfaults