Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id CE4B26329B6 for ; Fri, 3 Sep 2010 05:43:05 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 11854-10 for ; Fri, 3 Sep 2010 08:42:58 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mx4.wp.pl (mx4.wp.pl [212.77.101.8]) by mail.postgresql.org (Postfix) with ESMTP id C28B7632741 for ; Fri, 3 Sep 2010 05:42:57 -0300 (ADT) Received: (wp-smtpd smtp.wp.pl 14851 invoked from network); 3 Sep 2010 10:42:55 +0200 Received: from aazg85.neoplus.adsl.tpnet.pl (HELO [127.0.0.1]) (ipluta@[83.6.144.85]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with AES256-SHA encrypted SMTP for ; 3 Sep 2010 10:42:55 +0200 Message-ID: <4C80B50E.8050900@wp.pl> Date: Fri, 03 Sep 2010 10:42:54 +0200 From: Ireneusz Pluta User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: Kevin Grittner , "pgsql-admin@postgresql.org" Subject: Re: Autovacuum and invalid page header References: <4BEA8CD0.8070108@wp.pl> <4BEBC57002000025000316A3@gw.wicourts.gov> In-Reply-To: <4BEBC57002000025000316A3@gw.wicourts.gov> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-WP-AV: skaner antywirusowy poczty Wirtualnej Polski S. A. X-WP-SPAM: NO 0000000 [gaPU] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.61 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201009/35 X-Sequence-Number: 35579 Kevin Grittner pisze: > Ireneusz Pluta wrote: > > >> Is there >> any ready tool, which, for instance when given a path to database >> cluster, would traverse all cluster directories and files and >> check all page headers? I probably answered myself - manual VACUUM >> [VERBOSE] would do - but it fails when finds the first invalid >> header, so I would have. That's why I am looking for something >> only scanning and reporting invalid headers. >> > > I don't know of anything, but you might try searching pgfoundry. > Continuing revisiting my old thread, and to answer myself: find and pg_filedump seem to be the way, more-less like: find $PGDATA -type f -name [0-9]* | while read f; do echo $f && pg_filedump $f | grep -i invalid; done # not tested yet - of course keeping in mind that newly allocated pages might appear invalid to pg_filedump, while the server is running, as Tom explained just recently: > A newly-added page on disk will > be initially filled with zeroes, which I think pg_filedump will complain > about. It won't get overwritten with "valid" data until the page is > next written, either because of a checkpoint or because the buffer space > is needed for another page. pg_filedump can't see the state of the page > within the server's buffers, which is what counts here.