Re: R: round(x) function - Mailing list pgsql-general

From Tom Lane
Subject Re: R: round(x) function
Date
Msg-id 20164.1269635639@sss.pgh.pa.us
Whole thread Raw
In response to R: round(x) function  ("Gaietti, Mauro \(SELEX GALILEO Guest, Italy\)" <mauro.gaietti@guests.selexgalileo.com>)
List pgsql-general
"Gaietti, Mauro \(SELEX GALILEO Guest, Italy\)" <mauro.gaietti@guests.selexgalileo.com> writes:
> I think this is not consistent with documentation that says there is
> just one round function, with one argument of numeric type.

The documentation you're quoting says there is just one round function
that takes *two* arguments.  Which is true:

regression=# \df round
                          List of functions
   Schema   | Name  | Result data type | Argument data types |  Type
------------+-------+------------------+---------------------+--------
 pg_catalog | round | double precision | double precision    | normal
 pg_catalog | round | numeric          | numeric             | normal
 pg_catalog | round | numeric          | numeric, integer    | normal
(3 rows)

I don't think there's a claim anywhere that the numeric and double
precision versions of round(x) act identically.  They hardly could be
exactly identical anyway given the different properties of the two
datatypes.

            regards, tom lane

pgsql-general by date:

Previous
From: "Gaietti, Mauro \(SELEX GALILEO Guest, Italy\)"
Date:
Subject: R: round(x) function
Next
From: Bryan Murphy
Date:
Subject: Re: Warm Standby Setup Documentation