Re: pgsql: Avoid -Wconversion warnings when using checksum_impl.h

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: David Steele <david(at)pgmasters(dot)net>, pgsql-committers <pgsql-committers(at)lists(dot)postgresql(dot)org>
Subject: Re: pgsql: Avoid -Wconversion warnings when using checksum_impl.h
Date: 2020-03-06 00:48:58
Message-ID: 20200306004826.GB52814@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On Thu, Mar 05, 2020 at 04:14:20PM -0800, Magnus Hagander wrote:
> That's a pretty dangerous mistake, and moreso because we don't have a
> test around it. We should really find a way to add such a test -- just
> a hardcoded page calculation that should always return the same value
> perhaps?

Yes.. Using pg_checksums --check on an upgraded instance which had
checksums enabled would detect that immediately, but it could be
possible also to have a SQL-callable function which takes in input a
bytea and returns the checksum. In order to make such tests reliable
with any page size, we could pass down the page size to
pg_checksum_page(), and then give the function's caller this
possibility. However I recall that we'd rather keep BLCKSZ hardcoded
in checksum_impl.h on performance grounds.
--
Michael

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message David Steele 2020-03-06 00:58:50 Re: pgsql: Avoid -Wconversion warnings when using checksum_impl.h
Previous Message Stephen Frost 2020-03-06 00:39:59 Re: pgsql: Avoid -Wconversion warnings when using checksum_impl.h