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

From: Pavel Borisov <pashkin(dot)elfe(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
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-21 12:11:31
Message-ID: CALT9ZEGFM+fdKMJ-_-HP9mzm2nmrE7HjVritsz75EBiMbXGA+A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>
> 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

That was one of my intentions in the mentioned patch, but I couldn't
confirm that the page number (and offset) in SLRU was used signed not by
purpose. Thank you for confirming this. I will try to replace int to
unsigned where it is relevant in SLRU as part of the mentioned thread.
Though it could be a big change worth a separate patch maybe.

Again thanks!
Pavel

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dong Wook Lee 2022-03-21 12:12:37 Re: Add pg_freespacemap extension sql test
Previous Message Amit Kapila 2022-03-21 11:55:28 Re: Column Filtering in Logical Replication