| От | Tom Lane |
|---|---|
| Тема | Re: creating a new aggregate function |
| Дата | |
| Msg-id | 20952.1393892275@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: creating a new aggregate function (Seb <spluque@gmail.com>) |
| Список | pgsql-sql |
Seb <spluque@gmail.com> writes:
> Thanks for that suggestion. It seemed as if array_agg would allow me to
> define a new aggregate for avg as follows:
> CREATE AGGREGATE avg (angle_vector)
> (
> sfunc=array_agg,
> stype=anyarray,
> finalfunc=angle_vector_avg
> );
That's not going to work, for exactly this reason:
> ERROR: cannot determine transition data type
> DETAIL: An aggregate using a polymorphic transition type must have at least one polymorphic argument.
I see no reason to use a polymorphic type here anyway ... why not just
declare the transition data type as angle_vector[] ?
regards, tom lane
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера