From: Tom Lane <tgl@sss.pgh.pa.us>
To: Sam Barnett-Cormack <s.barnett-cormack@lancaster.ac.uk>
Cc: pgsql-admin@postgresql.org
Subject: Re: A problem
Date: Fri, 27 Jun 2003 11:37:43 -0400
Message-ID: <28227.1056728263@sss.pgh.pa.us> (raw)
In-Reply-To: <Pine.LNX.4.50.0306271537430.16916-100000@short.lancs.ac.uk>
References: <Pine.LNX.4.50.0306271537430.16916-100000@short.lancs.ac.uk>
Sam Barnett-Cormack <s.barnett-cormack@lancaster.ac.uk> writes:
> [ accidentally clobbered pg_control ]
It sounds like the main problem is too small a value in the XID
(transaction ID) counter, so that all your data tuples appear to be in
the future. pg_resetxlog has an option to force an initial XID but
you need to use it. You can guess a suitable XID by looking at the
names of the old clog files --- you want something that will be past
the end of the newest clog file, keeping in mind that there are 1M
(1024^2) XIDs per clog file and that the clog file names are in hex.
(I am not sure, but you might also need to provide a zero-filled clog
file spanning the point you start XID at.)
You will also need to be sure that the WAL file position
is greater than the end of the old WAL --- again, look at the existing
WAL files to see the largest number, and pick something bigger.
BTW, make real sure that pg_control is set up with the same locale
values as you were using before, or you'll be in a world of hurt
with corrupt indexes. Use pg_controldata to look at what you have put
into pg_control. (If you're not sure what was there before, get an
old copy of pg_control off your last backup tape ... you do have a
filesystem backup someplace, I trust ...)
> I still have the old
> /data/base dir, all that has been altered in there (recent mtime) is
> base/1175459/pg_internal.init
You can and probably should blow away pg_internal.init --- it's just a
cache file and can be rebuilt. I'd not trust it at this point.
regards, tom lane
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, s.barnett-cormack@lancaster.ac.uk
Subject: Re: A problem
In-Reply-To: <28227.1056728263@sss.pgh.pa.us>
References: <Pine.LNX.4.50.0306271537430.16916-100000@short.lancs.ac.uk> <28227.1056728263@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