Re: Does PostgreSQL check database integrity at startup?

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Jan Wieck <jan(at)wi3ck(dot)info>
Cc: Alban Hertroys <haramrae(at)gmail(dot)com>, Edson Carlos Ericksson Richter <richter(at)simkorp(dot)com(dot)br>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Does PostgreSQL check database integrity at startup?
Date: 2017-12-31 16:33:40
Message-ID: 20171231163340.GO2416@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jan, all,

* Jan Wieck (jan(at)wi3ck(dot)info) wrote:
> On Sat, Dec 30, 2017 at 10:27 AM, Stephen Frost <sfrost(at)snowman(dot)net> wrote:
> > The checksums included in PG are page-level and therefore there simply
> > isn't one to look at if the file is zero bytes.
>
> And even if the file wasn't zero bytes you can't tell from the per page
> CRCs if you have all the pages you should have. You could have extra pages
> that aren't supposed to be there or missing some (or any mix of the two).
> A per page CRC is useless for those cases.

Right, which is why it makes sense to have whole-file checksums when
doing things like backups, when you're already reading all of the file
and can grab a checksum in stream, to detect if anything bad happens
after the backup has compeleted to the file that's been backed up.

It's unclear if that would have helped here or not since we don't know
when the file ended up being zero'd out, as I understand it.

Thanks!

Stephen

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sherman Willden 2017-12-31 18:19:15 Find duplicates in a column then print Information to a file
Previous Message Peter Geoghegan 2017-12-31 13:58:48 Re: invalid memory alloc request size 576460752438159360