On Wed, Jan 14, 2015 at 1:52 PM, Tomas Vondra
<tomas.von...@2ndquadrant.com> wrote:
> Attached is v8 patch, with a few comments added:
>
> 1) before initArrayResult() - explaining when it's better to use a
>    single memory context, and when it's more efficient to use a
>    separate memory context for each array build state
>
> 2) before makeArrayResult() - explaining that it won't free memory
>    when allocated in a single memory context (and that a pfree()
>    has to be used if necessary)
>
> 3) before makeMdArrayResult() - explaining that it's illegal to use
>    release=true unless using a subcontext
>

I understand there is history to this API, and we need to be
compatible, but the end result is awkward.

I'm wondering whether it would be better to just have a new set of
functions like accumArrayResultElem, etc., and only allow astate=NULL
in the original accumArrayResult(). That cure might be worse than the
disease though.

Regards,
     Jeff Davis


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to