public inbox for [email protected]
help / color / mirror / Atom feedFrom: Peter Eisentraut <[email protected]>
To: Aleksander Alekseev <[email protected]>
To: pgsql-hackers <[email protected]>
Cc: Kirill Reshke <[email protected]>
Cc: David Rowley <[email protected]>
Cc: Tom Lane <[email protected]>
Subject: Re: Define DatumGetInt8 function.
Date: Fri, 27 Mar 2026 13:17:15 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAJ7c6TMcGu8qmRe1gZfJ-gOzVnZq-t=fwn-UuyStx1w6ZyydMw@mail.gmail.com>
References: <CALdSSPhFyb9qLSHee73XtZm1CBWJNo9+JzFNf-zUEWCRW5yEiQ@mail.gmail.com>
<[email protected]>
<CALdSSPg6UgK+6LJmFQ6G3av4J6dbngN7=QwQEuFZApnpmXgVWQ@mail.gmail.com>
<CAApHDvoShMiWPSkV8zE3tu7uo9GEmuoe=gTpM0+GfOFh2iDmmw@mail.gmail.com>
<CALdSSPjmukA1WGyYVqJMPD8080Rm9oXPVLn5T64xFCj6wKAenQ@mail.gmail.com>
<CAJ7c6TPsaLW7O67vqv8YyV_qUUjF0pncDB7dCQJFDw0so7wrdw@mail.gmail.com>
<CALdSSPjSaTvQL28csVo-8hNg8xJ5=YFr6qwtF=JAMLb1eJO2gQ@mail.gmail.com>
<CAJ7c6TM4zecvHj0F9Xk-V1gKqjYQOR4EjerTVkrZ18+w-6JN3Q@mail.gmail.com>
<[email protected]>
<CAJ7c6TMcGu8qmRe1gZfJ-gOzVnZq-t=fwn-UuyStx1w6ZyydMw@mail.gmail.com>
On 13.03.26 11:55, Aleksander Alekseev wrote:
> Hi Peter,
>
> Thanks for your feedback.
>
>> I'm tempted to think the correct direction here would be to use uint8
>> and its associated macros and functions more rigorously, not less.
>
> OK, if my understanding is correct this leaves us char_increment() and
> char_decrement() which currently use DatumGetUInt8 inconsistently with
> CharGetDatum for the argument and return value correspondingly.
>
>> I don't think it's worth making an isolated fix here for the one use of
>> UInt8GetDatum()
>
> I think you meant not this particular change so I included it to the
> patch. We can keep nbtcompare.c as if you believe this change is not
> that important (it arguably isn't).
>
>> The change in pageinspect looks correct, but then when you look
>> nearby and further around, you will find that there are also a bunch of
>> (if not most) UInt16GetDatum and UInt32GetDatum that are wrong
>> [...]
>
> Agree. I did my best to fix all the inconsistencies in pageinsect.
>
>> There are a lot of opportunities to clean this up, and I suspect that
>> while many of these will work either way in practice because the actual
>> values don't go far enough to hit the signed/unsigned boundary, I think
>> there could a number of little bugs here to be fixed.
>
> I believe you were referring to places other than pageinspect. I will
> investigate and create separate threads with corresponding patches
> later.
I'm moving this patch to the next commitfest. It's worth continuing to
work on making this more correct, but AFAICT no bug has been claimed
here, so it's not worth rushing this now.
view thread (10+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: Re: Define DatumGetInt8 function.
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox