Re: Fix unsigned output for signed values in SLRU error reporting

From: Andres Freund <andres(at)anarazel(dot)de>
To: Pavel Borisov <pashkin(dot)elfe(at)gmail(dot)com>
Cc: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Fix unsigned output for signed values in SLRU error reporting
Date: 2022-03-18 23:14:30
Message-ID: 20220318231430.m5g56yk4ztlz2man@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2022-03-18 23:20:49 Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15)
Previous Message Andres Freund 2022-03-18 23:09:44 Re: add checkpoint stats of snapshot and mapping files of pg_logical dir