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: Mark function arguments of type "Datum *" as "const Datum *" where possible
Date: 2025-09-26 05:56:30
Message-ID: CAEoWx2msfT0knvzUa72ZBwu9LR_RLY4on85w2a9YpE-o2By5HQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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
v1-0001-Mark-function-arguments-of-type-Datum-as-const-Da.patch application/octet-stream 59.0 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Richard Guo 2025-09-26 06:29:38 Re: plan shape work
Previous Message Michael Banck 2025-09-26 05:51:46 Re: GNU/Hurd portability patches