Re: Freeing transient memory in aggregate functions

From: Matt Magoffin <postgresql(dot)org(at)msqr(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Freeing transient memory in aggregate functions
Date: 2021-12-21 19:29:28
Message-ID: 39EAE32D-26ED-4D78-B8E4-1E838B35F9B1@msqr.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 21/12/2021, at 10:25 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Not quite like that. Look into nodeAgg.c, which solves a similar problem
> for the transvalues themselves with code like
>
> /* forget the old value, if any */
> if (!oldIsNull && !pertrans->inputtypeByVal)
> pfree(DatumGetPointer(oldVal));

Oh great, thanks for the tip!

— m@

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David Gauthier 2021-12-22 02:27:21 storing zipped SQLite inside PG ?
Previous Message Pavel Stehule 2021-12-21 19:04:27 Re: Packages, inner subprograms, and parameterizable anonymous blocks for PL/pgSQL