Search Postgresql Archives

Re: PostgreSQL documentation specifies 2-element array for float8_accum but 3-element array expected

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Disc Magnet <discmagnet@xxxxxxxxx> 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@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux