From: Larry Host <tfbu@tierratelecom.com>
To: pgsql-admin@postgresql.org
Subject: Deleted pg_log fix
Date: Thu, 28 Dec 2000 14:11:36 -0800
Message-ID: <000a01c0711b$2575b2a0$c30010ac@fusionnet.net> (raw)
Yup, I did it. Forced pg_log empty and almost lost EVERYTHING!
This is a RedHat 6.2 on an i386 class system.
Thanks to a few threads in this group, I was able to save 100% of my data, almost a gig.
I do not use XID's and have been warned that they may be lost using this method.
What I did:
First thing I did was make a huge tarball of the entire data directory for safety.
I then edited the following 2 files in the postgresql-7.0.2 source tree
/usr/src/postgresql-7.0.2/src/backend/access/transam/transsup.c
line 44 or so
added "AMI_OVERRIDE=true;" IMMEDIATELY AFTER "AMI_OVERRIDE=flag;"
/usr/src/postgresql-7.0.2/src/backend/access/transam/xact.c
line 238 or so
added "AMI_OVERRIDE=true;" IMMEDIATELY AFTER "AMI_OVERRIDE=false;"
Then return to /usr/src/postgresql-7.0.2/src and
gmake clean
gmake
gmake install
Then went to /usr/local/pgsql/bin and cp'd all files to my /usr/bin, replacing the old pg commands
At this point I was able to use "pg_dump -di" on each database and recover all schema and data 100%.
I then unmodified the files, recompiled and reloaded the execs to /usr/bin, created a new db and used psql to read in the old data and schema.
This might not work for everyone but it saved MY ass and I hope it can save yours.
Larry Host
CTO
Tierra Telecom, Inc.
858-587-2218
858-587-2451 Fax
tfbu@tierratelecom.com
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: tfbu@tierratelecom.com
Subject: Re: Deleted pg_log fix
In-Reply-To: <000a01c0711b$2575b2a0$c30010ac@fusionnet.net>
References: <000a01c0711b$2575b2a0$c30010ac@fusionnet.net>
* 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