pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Magnus Hagander <magnus@hagander.net>
Cc: David Steele <david@pgmasters.net>
Cc: pgsql-committers <pgsql-committers@lists.postgresql.org>
Subject: Re: pgsql: Avoid -Wconversion warnings when using checksum_impl.h
Date: Fri, 6 Mar 2020 09:48:58 +0900
Message-ID: <20200306004826.GB52814@paquier.xyz> (raw)
In-Reply-To: <CABUevEzoWeR_q-JztqacmATBvVMUL9rtOcpM5RACubKcmhmk3Q@mail.gmail.com>
References: <E1j9ioh-0005Kn-4O@gemulon.postgresql.org>
	<1cf30561-7dad-dc6e-9fc3-5c456948cfeb@pgmasters.net>
	<20200305233014.GA2501@paquier.xyz>
	<CABUevEzoWeR_q-JztqacmATBvVMUL9rtOcpM5RACubKcmhmk3Q@mail.gmail.com>

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

Attachments:

  [application/pgp-signature] signature.asc (832B, ../20200306004826.GB52814@paquier.xyz/2-signature.asc)
  download

view thread (14+ messages)  latest in thread

Message-ID: <20200306004826.GB52814@paquier.xyz>
Permalink:  ../20200306004826.GB52814@paquier.xyz/
Also on:    postgresql.org/message-id/20200306004826.GB52814@paquier.xyz

 · 

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: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, magnus@hagander.net, david@pgmasters.net, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Avoid -Wconversion warnings when using checksum_impl.h
  In-Reply-To: <20200306004826.GB52814@paquier.xyz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox