diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2001-08-14 22:21:59 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2001-08-14 22:21:59 +0000 |
| commit | 5f7c2bdb537bd18fd7f1cc942950e7e64c6e0a92 (patch) | |
| tree | deb73ae98b59fb4315f82b781a7c22859cbccd00 /doc/src | |
| parent | 6f2943b52e9f4af3c4488c0373a3490e38c032a7 (diff) | |
sum() on int2 and int4 columns now uses an int8, not numeric, accumulator
for speed reasons; its result type also changes to int8. avg() on these
datatypes now accumulates the running sum in int8 for speed; but we still
deliver the final result as numeric, so that fractional accuracy is
preserved.
count() now counts and returns in int8, not int4. I am a little nervous
about this possibly breaking users' code, but there didn't seem to be
a strong sentiment for avoiding the problem. If we get complaints during
beta, we can change count back to int4 and add a "count8" aggregate.
For that matter, users can do it for themselves with a simple CREATE
AGGREGATE command; the int4inc function is still present, so no C hacking
is needed.
Also added max() and min() aggregates for OID that do proper unsigned
comparison, instead of piggybacking on int4 aggregates.
initdb forced.
Diffstat (limited to 'doc/src')
| -rw-r--r-- | doc/src/sgml/func.sgml | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index d4dda3c412a..6bb793a9c85 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -1,4 +1,4 @@ -<!-- $Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.64 2001/07/11 22:14:01 momjian Exp $ --> +<!-- $Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.65 2001/08/14 22:21:58 tgl Exp $ --> <chapter id="functions"> <title>Functions and Operators</title> @@ -3768,7 +3768,7 @@ SELECT NULLIF(value, '(none)') ... <row> <entry>COUNT(*)</entry> <entry>number of input values</entry> - <entry>The return value is of type <type>integer</type>.</entry> + <entry>The return value is of type <type>bigint</type>.</entry> </row> <row> @@ -3777,7 +3777,7 @@ SELECT NULLIF(value, '(none)') ... Counts the input values for which the value of <replaceable class="parameter">expression</replaceable> is not NULL. </entry> - <entry></entry> + <entry>The return value is of type <type>bigint</type>.</entry> </row> <row> @@ -3822,7 +3822,9 @@ SELECT NULLIF(value, '(none)') ... <type>smallint</type>, <type>integer</type>, <type>bigint</type>, <type>real</type>, <type>double precision</type>, <type>numeric</type>, <type>interval</type>. - The result is of type <type>numeric</type> for any integer type + The result is of type <type>bigint</type> for <type>smallint</type> + or <type>integer</type> input, <type>numeric</type> for + <type>bigint</type> input, <type>double precision</type> for floating point input, otherwise the same as the input data type. </entry> @@ -3836,7 +3838,8 @@ SELECT NULLIF(value, '(none)') ... <primary>variance</primary> </indexterm> The variance is the square of the standard deviation. The - supported data types are the same. + supported data types and result types are the same as for + standard deviation. </entry> </row> @@ -3848,7 +3851,8 @@ SELECT NULLIF(value, '(none)') ... It should be noted that except for <function>COUNT</function>, these functions return NULL when no rows are selected. In particular, <function>SUM</function> of no rows returns NULL, not - zero as one might expect. + zero as one might expect. <function>COALESCE</function> may be + used to substitute zero for NULL when necessary. </para> </sect1> |
