Re: Make pg_checksums complain if compiled BLCKSZ and data folder's block size differ

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Magnus Hagander <magnus(at)hagander(dot)net>, Michael Banck <michael(dot)banck(at)credativ(dot)de>, Sergei Kornilov <sk(at)zsrv(dot)org>
Subject: Re: Make pg_checksums complain if compiled BLCKSZ and data folder's block size differ
Date: 2019-03-16 08:18:34
Message-ID: alpine.DEB.2.21.1903160911080.2506@lancre
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Bonjour Michaël,

> If the block size the tool is compiled with does not match the data
> folder block size, then users would get incorrect checksums failures,

Or worse, incorrect checksump writing under "enabling"?

Initial proposal:

"%s: data directory block size %d is different to compiled-in block size %d.\n"

> Has somebody a better wording for that? Attached is a proposal of
> patch.

"%s: database files are incompatible with pg_checksums.\n"
"%s: The database cluster was initialized with BLCKSZ %u, but pg_checksums was compiled with BLCKSZ %u."

Second line is missing a "\n". "pg_checksums" does not need to appear, it
is already the progname, and if it differs there is no point in giving a
wrong name. I think it could be shorter. What about:

"%s: cannot compute checksums, command compiled with BLCKSZ %u but cluster initialized with BLCKSZ %u.\n"

I think it would be better to adapt the checksum computation, but this is
indeed non trivial because of the way the BLCKSZ constant is hardwired
into type declarations.

--
Fabien.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2019-03-16 08:39:48 Re: libpq environment variables in the server
Previous Message Haribabu Kommi 2019-03-16 06:43:10 Re: Pluggable Storage - Andres's take