pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: John Lister <john.lister-ps@kickstone.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Database corruption help
Date: Fri, 13 Feb 2009 11:28:28 -0500
Message-ID: <3304.1234542508@sss.pgh.pa.us> (raw)
In-Reply-To: <49952D33.3000707@kickstone.com>
References: <507152DDF8AB4DF093BD01A8BEC7C659@squarepi.com>
	<17205.1234200693@sss.pgh.pa.us>
	<AB15E89CD7FB4EBD9D76CC5F8D8B3D4E@squarepi.com>
	<4990840C.4090900@kickstone.com>
	<20151.1234208044@sss.pgh.pa.us>
	<49908D72.7040904@kickstone.com>
	<25753.1234224090@sss.pgh.pa.us>
	<4991338B.704@kickstone.com>
	<4994906B.6090408@kickstone.com>
	<17204.1234474784@sss.pgh.pa.us>
	<4994987F.1030204@kickstone.com>
	<17764.1234476783@sss.pgh.pa.us>
	<4994A45B.4030707@kickstone.com>
	<49952D33.3000707@kickstone.com>

John Lister <john.lister-ps@kickstone.com> writes:
> Any help would be appreciated as the pg_class table is constantly 
> growing which i'm guessing is going to start to affect performance 
> fairly soon. I'd like to avoid a full restore from backup if possible.

BTW, what I would recommend as a recovery action is to zero out that
page of pg_class while the postmaster is stopped.  We know that none
of those rows are useful to you, and there shouldn't be any index
entries pointing at them (since they're all HOT tuples), so at least
in theory that won't cause any damage.  Then you can try another
VACUUM FULL and see if there are any more pages with, er, issues.

If you're on a machine that has /dev/zero then something like this
should work:

dd bs=8k count=1 seek=15538 conv=notrunc if=/dev/zero of=$PGDATA/base/16392/1259

but it'd be a good idea to save a copy of the target file so you can try
again if you mess up.

Also, it'd really be prudent to do a dump, initdb, reload once you
get to a point where pg_dump succeeds without complaints.  We don't
have any good way to know what other corruption might be lurking
undetected.

			regards, tom lane



view thread (19+ messages)  latest in thread

Message-ID: <3304.1234542508@sss.pgh.pa.us>
Permalink:  ../3304.1234542508@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3304.1234542508@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, john.lister-ps@kickstone.com, pgsql-hackers@postgresql.org
  Subject: Re: Database corruption help
  In-Reply-To: <3304.1234542508@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox