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