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

2019-03-17 Thread Michael Paquier
On Sun, Mar 17, 2019 at 12:01:31PM +0100, Magnus Hagander wrote: > LGTM. Okay, committed. -- Michael signature.asc Description: PGP signature

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

2019-03-17 Thread Magnus Hagander
On Sun, Mar 17, 2019 at 6:47 AM Michael Paquier wrote: > On Sat, Mar 16, 2019 at 09:18:34AM +0100, Fabien COELHO wrote: > > 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 declarat

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

2019-03-17 Thread Magnus Hagander
On Sun, Mar 17, 2019 at 10:10 AM Michael Paquier wrote: > On Sat, Mar 16, 2019 at 11:18:17AM +0100, Magnus Hagander wrote: > > BLCKSZ is very much an internal term. The exposed name through > pg_settings > > is block_size, so I think the original was better. Combining that one > with > > yours in

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

2019-03-17 Thread Michael Paquier
On Sat, Mar 16, 2019 at 11:18:17AM +0100, Magnus Hagander wrote: > BLCKSZ is very much an internal term. The exposed name through pg_settings > is block_size, so I think the original was better. Combining that one with > yours into "initialized with block size %d" etc, makes it a lot nicer. Yes,

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

2019-03-17 Thread Fabien COELHO
I'm not sure that prefixing the two lines with the comment line is very elegant, I'd suggest to put spaces, and would still try to shorten the second sentence, maybe: I suggest to keep two lines, and only prefix the first one. As you feel. For me the shorter the better, though, if the infor

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

2019-03-17 Thread Michael Paquier
On Sun, Mar 17, 2019 at 09:17:02AM +0100, Fabien COELHO wrote: > I'm not sure that prefixing the two lines with the comment line is very > elegant, I'd suggest to put spaces, and would still try to shorten the > second sentence, maybe: I suggest to keep two lines, and only prefix the first one. --

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

2019-03-17 Thread Fabien COELHO
Something like "%s: database folder is incompatible" for the first line sounds kind of better per the feedback gathered. And then on the second line: "The database cluster was initialized with block size %u, but pg_checksums was compiled with block size %u." Ok. "%s" progname instead of "pg_

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

2019-03-16 Thread Michael Paquier
On Sat, Mar 16, 2019 at 09:18:34AM +0100, Fabien COELHO wrote: >> 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"? Let's hope that we make that p

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

2019-03-16 Thread Magnus Hagander
On Sat, Mar 16, 2019 at 2:22 AM Michael Paquier wrote: > Hi all, > (related folks in CC) > > Sergei Kornilov has reported here an issue with pg_checksums: > > https://www.postgresql.org/message-id/5217311552474...@myt2-66bcb87429e6.qloud-c.yandex.net > > If the block size the tool is compiled wit

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

2019-03-16 Thread Fabien COELHO
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