Re: PostgreSQL documentation specifies 2-element array for float8_accum but 3-element array expected - Mailing list pgsql-general

From Tom Lane
Subject Re: PostgreSQL documentation specifies 2-element array for float8_accum but 3-element array expected
Date
Msg-id 26511.1300891275@sss.pgh.pa.us
Whole thread Raw
In response to PostgreSQL documentation specifies 2-element array for float8_accum but 3-element array expected  (Disc Magnet <discmagnet@gmail.com>)
List pgsql-general
Disc Magnet <discmagnet@gmail.com> writes:
> CREATE AGGREGATE myavg(float8) (
>     sfunc = float8_accum,
>     stype = float8[],
>     finalfunc = float8_avg,
>     initcond = '{0,0}'
> );

> On trying to run this, I get this error:

> cdb=# select myavg(value) from numbers;
> ERROR:  float8_accum: expected 3-element float8 array

Hm, it looks like that example has been wrong from day one ---
float8_accum has expected a 3-element array for its entire existence.
I thought maybe the code and docs had gotten out of sync later, but
AFAICS this was a thinko in the original commit.  Should say
    initcond = '{0,0,0}'

            regards, tom lane

pgsql-general by date:

Previous
From: salah jubeh
Date:
Subject: Re: General question
Next
From: "David Johnston"
Date:
Subject: Re: General question