Re: Mark function arguments of type "Datum *" as "const Datum *" where possible

Chao Li <li.evan.chao@gmail.com>

From: Chao Li <li.evan.chao@gmail.com>
To: Postgres hackers <pgsql-hackers@lists.postgresql.org>, Peter Eisentraut <peter@eisentraut.org>
Date: 2025-09-26T07:35:54Z
Lists: pgsql-hackers

Attachments

Revision to v2.

Chao Li (Evan)
---------------------
HighGo Software Co., Ltd.
https://www.highgo.com/


On Fri, Sep 26, 2025 at 1:56 PM Chao Li <li.evan.chao@gmail.com> wrote:

> Hi Hackers,
>
> I noticed that many functions take "Datum *" parameters while they don't
> update the data. So I created this patch to change "Datum *" to "const
> Datum *" wherever possible, which should improve type safety and make the
> interfaces clearer about their intent, also helps the compiler catch
> accidental modifications.
>
> Best regards,
> Chao Li
> ---------------------
> HighGo Software Co., Ltd.
> https://www.highgo.com/
>

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Mark function arguments of type "Datum *" as "const Datum *" where possible