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

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Peter Eisentraut <peter(at)eisentraut(dot)org>
Subject: Re: Mark function arguments of type "Datum *" as "const Datum *" where possible
Date: 2025-09-26 07:35:54
Message-ID: CAEoWx2m=N+P+ckkLFDBFpcrkZ_smGCS+hqbjpsLamu8ORQxdkw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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(dot)evan(dot)chao(at)gmail(dot)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/
>

Attachment Content-Type Size
v2-0001-Mark-function-arguments-of-type-Datum-as-const-Da.patch application/octet-stream 48.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bertrand Drouvot 2025-09-26 08:04:38 Re: Add memory_limit_hits to pg_stat_replication_slots
Previous Message Guillaume Lelarge 2025-09-26 07:28:15 Re: [BUG] temporary file usage report with extended protocol and unnamed portals