Re: Mark function arguments of type "Datum *" as "const Datum *" where possible - Mailing list pgsql-hackers

From Chao Li
Subject Re: Mark function arguments of type "Datum *" as "const Datum *" where possible
Date
Msg-id CAEoWx2m=N+P+ckkLFDBFpcrkZ_smGCS+hqbjpsLamu8ORQxdkw@mail.gmail.com
Whole thread Raw
In response to Mark function arguments of type "Datum *" as "const Datum *" where possible  (Chao Li <li.evan.chao@gmail.com>)
Responses Re: Mark function arguments of type "Datum *" as "const Datum *" where possible
Re: Mark function arguments of type "Datum *" as "const Datum *" where possible
List 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.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/
Attachment

pgsql-hackers by date:

Previous
From: Guillaume Lelarge
Date:
Subject: Re: [BUG] temporary file usage report with extended protocol and unnamed portals
Next
From: Bertrand Drouvot
Date:
Subject: Re: Add memory_limit_hits to pg_stat_replication_slots