Joe Conway <mail@joeconway.com> writes:
> How can you create an aggregate using an operator as a transition function?
You'd have to reference the underlying function. I think what Peter is
really asking is whether the implementation function for || will serve
for this purpose, rather than making an additional one.
> Also (I suppose you could argue this should be fixed, but anyway...),
> you can't currently add elements to an empty array.
That particular manifestation is not relevant; I think you mean this
one:
regression=# select '{}'::int4[] || 2;
ERROR: Arrays greater than one-dimension are not supported
In both cases I think it's mostly a matter of defining a defensible
behavior, which is probably not that hard, but no one's yet gotten
annoyed enough to try to fix it.
regards, tom lane