[PATCH] Rename trim_array() for consistency with the rest of array_* functions

From: Aleksander Alekseev <aleksander(at)timescale(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: [PATCH] Rename trim_array() for consistency with the rest of array_* functions
Date: 2024-10-29 12:01:10
Message-ID: CAJ7c6TMR+=SOPj9WTMeMo3_nr7_ioE8-ivisqCA9Wc+nLt3VXA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi hackers,

Currently most of the functions dealing with arrays ( except for
unnest() and cardinality() ) start with `array_` prefix [1] -
array_length(), array_fill(), etc. Also this is how we name the new
functions, e.g. recently proposed array_sort() [2] and array_reverse()
[3]. The only exception from this rule is trim_array() which might be
somewhat misleading. For instance, it is not show in the output of:

```
\df array_*
```

The proposed patch renames trim_array() to array_trim(). The old
function is kept for backward compatibility but is marked as
deprecated and is left undocumented. It can be removed in 10 years
from now or so. To my knowledge this is how we typically deprecate old
functions and operators.

Thoughts?

[1]: https://www.postgresql.org/docs/current/functions-array.html
[2]: https://commitfest.postgresql.org/50/5277/
[3]: https://commitfest.postgresql.org/50/5314/

--
Best regards,
Aleksander Alekseev

Attachment Content-Type Size
v1-0001-Rename-trim_array-to-array_trim.patch application/octet-stream 5.9 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ranier Vilela 2024-10-29 12:07:15 Avoid possible useless call to makeNode function (src/backend/commands/view.c)
Previous Message Peter Eisentraut 2024-10-29 11:54:03 Re: doc issues in event-trigger-matrix.html