Hi Felipe,

On 04 Jan 2003 13:58:13 -0600, you wrote:

>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,

[...]

have you tried to follow the Tom Lane suggestion to explicit cast the
first parameter in the call to round function ?

Anyway, to avoid writing queries and triggers to port existing
database to newer versions of Postgres you can define the following
very simple function:

-----------------------------------------------------------------

create function round (double precision, integer) returns double
precision as '

       select cast(round(cast($1 as numeric),$2) as double precision);

' LANGUAGE SQL with(iscachable) ;

----------------------------------------------------------------


I hope this can help someone.


Regards,
                                                Silvio Scarpati




---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Reply via email to