Re: array functions - request for opinions (was Re: [PATCHES] array - Mailing list pgsql-hackers

From Tom Lane
Subject Re: array functions - request for opinions (was Re: [PATCHES] array
Date
Msg-id 2014.1053966167@sss.pgh.pa.us
Whole thread Raw
In response to Re: array functions - request for opinions (was Re: [PATCHES]  (Joe Conway <mail@joeconway.com>)
Responses Re: array functions - request for opinions (was Re: [PATCHES]  (Joe Conway <mail@joeconway.com>)
List pgsql-hackers
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


pgsql-hackers by date:

Previous
From: Joe Conway
Date:
Subject: Re: array functions - request for opinions (was Re: [PATCHES]
Next
From: Joe Conway
Date:
Subject: Re: array functions - request for opinions (was Re: [PATCHES]