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

From David Geier
Subject Cleaning up array_ref() and array_set()
Date
Msg-id 5bb669cc-7c48-4a50-b0b6-0612f95426d1@gmail.com
Whole thread Raw
Responses Re: Cleaning up array_ref() and array_set()
List pgsql-hackers
Hi hackers,

We have array_ref() and array_set() which are merely wrappers around
array_get_element() and array_set_element(). The wrappers take an
ArrayType * argument while array_{get|set}_element() take a Datum as
argument; like most of the other array functions.

array_ref() and array_set() are relicts from the following commit from 2015:


commit e983c4d1aa42d613542cf222e222b034918374b1
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date:   Mon Feb 16 12:23:58 2015 -0500

...
However, there's a fair amount of code using array_ref and array_set
with arrays that *are* known to be ArrayType structures, and there might
be more such places in third-party code.


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()?

--
David Geier



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Non-text mode for pg_dumpall
Next
From: Peter Eisentraut
Date:
Subject: Re: remove unnecessary include in src/backend/commands/policy.c