Re: Fix unsigned output for signed values in SLRU error reporting - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Fix unsigned output for signed values in SLRU error reporting
Date
Msg-id 20220318231430.m5g56yk4ztlz2man@alap3.anarazel.de
Whole thread Raw
In response to Fix unsigned output for signed values in SLRU error reporting  (Pavel Borisov <pashkin.elfe@gmail.com>)
Responses Re: Fix unsigned output for signed values in SLRU error reporting  (Pavel Borisov <pashkin.elfe@gmail.com>)
List pgsql-hackers
Hi,

On 2022-03-18 22:52:02 +0400, Pavel Borisov wrote:
> I've noticed that in SRLU error reporting both signed and unsigned values
> are output as %u. I think it is worth correcting this with the very simple
> patch attached.

Afaics offset etc can't be negative, so I don't think this really improves
matters. I think there's quite a few other places where we use %u to print
integers that we know aren't negative.

If anything I think we should change the signed integers to unsigned ones. It
might be worth doing that as part of
https://www.postgresql.org/message-id/CAJ7c6TPDOYBYrnCAeyndkBktO0WG2xSdYduTF0nxq%2BvfkmTF5Q%40mail.gmail.com

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: add checkpoint stats of snapshot and mapping files of pg_logical dir
Next
From: Andres Freund
Date:
Subject: Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15)