Deleted pg_log fix

From: "Larry Host" <tfbu(at)tierratelecom(dot)com>
To: <pgsql-admin(at)postgresql(dot)org>
Subject: Deleted pg_log fix
Date: 2000-12-28 22:11:36
Message-ID: 000a01c0711b$2575b2a0$c30010ac@fusionnet.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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(at)tierratelecom(dot)com

Browse pgsql-admin by date

  From Date Subject
Next Message James Clawson 2000-12-29 16:12:33 Can't CREATE USER
Previous Message Jean-Arthur Silve 2000-12-28 11:27:32 ENABLE_SEQSCAN default value