Incorrect GetDatum() macros not match with SQL function types

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Aleksander Alekseev <aleksander(at)tigerdata(dot)com>
Subject: Incorrect GetDatum() macros not match with SQL function types
Date: 2026-04-30 05:46:17
Message-ID: afLsqRjVqKK8hhKk@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all,
(Aleksander in CC, who has authored some of them in pageinspect.)

While looking at the business in [1], I have noticed a bunch of areas
in the code base where the *GetDatum() macros used do not match with
the data type of the SQL functions they relate to, leading me to the
attached.

I am creating a new thread for clarity, as the patch was hidden in the
middle of a different discussion.

When it comes to the numbers touched here, the signedness should not
matter, so this most likely a cleanup worth doing for v20, not v19.

Thanks,

[1]: https://www.postgresql.org/message-id/CAJ7c6TMcGu8qmRe1gZfJ-gOzVnZq-t=fwn-UuyStx1w6ZyydMw@mail.gmail.com
--
Michael

Attachment Content-Type Size
0001-Fix-more-Datum-conversion-inconsistencies.patch text/plain 16.2 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message vignesh C 2026-04-30 05:56:59 Re: [PATCH] Fix stale relation close in sequence synchronization
Previous Message Michael Paquier 2026-04-30 05:28:04 Re: Define DatumGetInt8 function.