Re: Make pg_checksums complain if compiled BLCKSZ and data folder'sblock size differ - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: Make pg_checksums complain if compiled BLCKSZ and data folder'sblock size differ
Date
Msg-id alpine.DEB.2.21.1903160911080.2506@lancre
Whole thread Raw
In response to Make pg_checksums complain if compiled BLCKSZ and data folder'sblock size differ  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Make pg_checksums complain if compiled BLCKSZ and data folder'sblock size differ
List 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.

pgsql-hackers by date:

Previous
From: Haribabu Kommi
Date:
Subject: Re: Pluggable Storage - Andres's take
Next
From: Peter Eisentraut
Date:
Subject: Re: libpq environment variables in the server