Re: PG_FREE_IF_COPY extraneous in numeric_cmp?

From: CK Tan <cktan(at)vitessedata(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: PG_FREE_IF_COPY extraneous in numeric_cmp?
Date: 2023-02-25 12:19:20
Message-ID: CAJNt7=aMV=3rmF1V_JGNyeWsoKNOiy5jrkDDzQx1Md7NEXA+fg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thanks!

On Fri, Feb 24, 2023 at 2:16 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> CK Tan <cktan(at)vitessedata(dot)com> writes:
> > Isn't it true that pfree() will never be called by PG_FREE_IF_COPY?
>
> No. You're forgetting the possibility that PG_GETARG_NUMERIC will
> have to de-toast a toasted input. Granted, numerics are seldom
> going to be long enough to get compressed or pushed out-of-line;
> but that's possible, and what's very possible is that they'll have
> a short header.
>
> regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2023-02-25 12:56:30 broken formatting?
Previous Message Tomas Vondra 2023-02-25 11:45:28 Re: BRIN indexes vs. SK_SEARCHARRAY (and preprocessing scan keys)