Re: PG_FREE_IF_COPY extraneous in numeric_cmp?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: CK Tan <cktan(at)vitessedata(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: PG_FREE_IF_COPY extraneous in numeric_cmp?
Date: 2023-02-24 22:16:16
Message-ID: 1060531.1677276976@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Corey Huinker 2023-02-24 22:36:42 Re: verbose mode for pg_input_error_message?
Previous Message Heikki Linnakangas 2023-02-24 21:07:33 Re: BRIN indexes vs. SK_SEARCHARRAY (and preprocessing scan keys)