Hi, On Sat, Mar 03, 2018 at 07:23:31PM +0100, Magnus Hagander wrote: > diff --git a/src/bin/pg_verify_checksums/pg_verify_checksums.c > b/src/bin/pg_verify_checksums/pg_verify_checksums.c > new file mode 100644 > index 0000000000..a4bfe7284d > --- /dev/null > +++ b/src/bin/pg_verify_checksums/pg_verify_checksums.c > @@ -0,0 +1,308 @@ [...]
> +/* > + * pg_verify_checksums > + * > + * Verifies page level checksums in an offline cluster > + * > + * Copyright (c) 2010-2018, PostgreSQL Global Development Group Weird copyright statement for a new file, did you base it off another one, or just copy-pasted the boilerplate? [...] > + csum = pg_checksum_page(buf, blockno + segmentno*RELSEG_SIZE); > + if (csum != header->pd_checksum) > + { > + if (ControlFile->data_checksum_version == > PG_DATA_CHECKSUM_VERSION) > + fprintf(stderr, _("%s: %s, block %d, invalid > checksum in file %X, calculated %X\n"), > + progname, fn, blockno, > header->pd_checksum, csum); The error message sounds a bit strange to me, I would expect the filename after "in file [...]", but you print the expected checksum. Also, 'invalid' sounds a bit like we found something which is malformed checksum (no hex), so maybe "checksum mismatch in file, expected %X, found %X" or something? Michael -- Michael Banck Projektleiter / Senior Berater Tel.: +49 2166 9901-171 Fax: +49 2166 9901-100 Email: michael.ba...@credativ.de credativ GmbH, HRB Mönchengladbach 12080 USt-ID-Nummer: DE204566209 Trompeterallee 108, 41189 Mönchengladbach Geschäftsführung: Dr. Michael Meskes, Jörg Folz, Sascha Heuer