From: | Scott Marlowe <smarlowe(at)g2switchworks(dot)com> |
---|---|
To: | Eric Parusel <lists(at)globalrelay(dot)net> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: how do I clear a page, or set an item in a page to |
Date: | 2005-03-21 19:45:23 |
Message-ID: | 1111434323.26897.184.camel@state.g2switchworks.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Wouldn't zero_damaged_pages help here?
http://www.postgresql.org/docs/7.4/static/runtime-config.html#RUNTIME-CONFIG-DEVELOPER
On Mon, 2005-03-21 at 13:28, Eric Parusel wrote:
> Tom Lane wrote:
> > Eric Parusel <lists(at)globalrelay(dot)net> writes:
> >
> >>I've got a mucked up page in my db, and I can't complete a database dump
> >>until a particular page is fixed/removed from the table. :(
> >
> > Zeroing the page is the most painless way. dd from /dev/zero will get
> > it done --- but note that you have to shut down the postmaster meanwhile
> > to ensure Postgres will see your change.
>
> 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)
>
> from pg_filedump:
> Block 28393 ********************************************************
> <Header> -----
> Block Offset: 0x0ddd2000 Offsets: Lower 56 (0x0038)
> Block: Size 8192 Version 2 Upper 1064 (0x0428)
> LSN: logid 242 recoff 0x9387bd78 Special 8192 (0x2000)
> Items: 9 Free Space: 1008
> Length (including item array): 60
>
> So I could take the block offset, convert it from hex (to 232595456...
> oh, /8192 = 28393 :) ), and the block size (which is default: 8192) to do:
>
> dd if=/dev/zero of=base/17760/18804 obs=8192 seek=28393
> ?
>
> Should I, or do I need to REINDEX after this?
>
> If you could confirm that I answered my own question, that would be
> great :)
>
> Thanks,
> Eric
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2005-03-21 19:48:16 | Re: how do I clear a page, or set an item in a page to |
Previous Message | Eric Parusel | 2005-03-21 19:28:03 | Re: how do I clear a page, or set an item in a page to |