Re: Cleaning up array_ref() and array_set() - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Cleaning up array_ref() and array_set()
Date
Msg-id 4041738.1771969903@sss.pgh.pa.us
Whole thread Raw
In response to Re: Cleaning up array_ref() and array_set()  (Álvaro Herrera <alvherre@kurilemu.de>)
List pgsql-hackers
=?utf-8?Q?=C3=81lvaro?= Herrera <alvherre@kurilemu.de> writes:
> On 2026-Feb-24, David Geier wrote:
>> This has changed over the years. On master there are only 5 calls to
>> array_ref() and 5 calls to array_set() left. Are there any objections
>> against cleaning up the code by removing array_ref() and array_set()?

> For me the answer would be, if we gain something, and the change is easy
> for them to make, then sure, let's change it.  If we don't gain
> anything, then ... why break things for them?

Yeah, I'm pretty much -1 on this proposal.  Those functions are
trivial wrappers, for sure, but by the same token removing them
saves almost nothing.  Also, it would cost code and legibility
at the call sites, which would have to add PointerGetDatum() and
DatumGetArrayTypeP() steps.  So on balance this hardly seems like
a win even without considering its side-effects on extensions.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Ilia Evdokimov
Date:
Subject: Re: Reduce planning time for large NOT IN lists containing NULL
Next
From: Peter Eisentraut
Date:
Subject: Re: change default default_toast_compression to lz4?