Re: how do I clear a page, or set an item in a page to - Mailing list pgsql-general

From Eric Parusel
Subject Re: how do I clear a page, or set an item in a page to
Date
Msg-id 423F30CC.60000@globalrelay.net
Whole thread Raw
In response to Re: how do I clear a page, or set an item in a page to  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Tom Lane wrote:
> Eric Parusel <lists@globalrelay.net> writes:
>
>>ok, I can dd, if=/dev/zero of=base/dbnum/tablenum, but how do I figure
>>how where and how much to write over?
>>Is there an easy to see or calculate offset value for a particular page
>>number? (28393)
>
> dd bs=8k seek=28393 count=1

shutdown postgres
cp base/dbnum/tablenum* /somewhere/else
dd if=/dev/zero of=base/dbnum/tablenum bs=8k seek=28393 count=1
startup postgres

It worked...!   select count(*) from table; now works fine!
I'm currently doing a vacuum then a db dump to confirm there's no other
page issues...

Vacuum is aptly reporting:
WARNING: relation "table" page 28393 is uninitialized --- fixing

Thanks for your assistance, hopefully this helps someone else in the
future a little bit.

I don't know why the problem occurred, but I don't think it's realistic
to figure that out easily. (disk, raid, server, os, pgsql, or some
combination!)

Eric

pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Encoding-related errors when moving from 7.3 to 8.0.1
Next
From: TJ O'Donnell
Date:
Subject: bit varying(512) vs bytea(64)