Disc Magnet <discmag...@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

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to