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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: PostgreSQL documentation specifies 2-element array for float8_accum but 3-element array expected
Дата
Msg-id 26511.1300891275@sss.pgh.pa.us
обсуждение исходный текст
Ответ на PostgreSQL documentation specifies 2-element array for float8_accum but 3-element array expected  (Disc Magnet <discmagnet@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: salah jubeh
Дата:
Сообщение: Re: General question
Следующее
От: "David Johnston"
Дата:
Сообщение: Re: General question