Replacing the corrupt "global" folder with older one

From: "chris(dot)jurado" <chris(dot)jurado(at)primesoft(dot)ph>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: Replacing the corrupt "global" folder with older one
Date: 2008-03-04 05:02:56
Message-ID: 200803041302.AA7077938@primesoft.ph
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Sorry for sending this directly to the hackers mailing list. But, i think it did not belong in any other as it involves internals about the files in the data directory.

PostgreSQL version: 8.1.2
Operating system: Windows XP/2003

The PostgreSQL service is not starting anymore. When I manually start it, it said something like it started but ended immediately because it had no work to do. I encountered this error before but a simple re-installation fixed it. This time, it didn't.

I've tried running the service using a backup data folder w/c was 2 days ago, it runs. When I switch back to the current, I get the error above. So, I figured the current data must be corrupt. After examination of the data folder, the global folder is now not a folder but a file that is 8KB in size (I found this out by trying out the reset_xlog command and it said it could no longer find the global/xxx file). It could be the hard disk has a problem. I'm going to replace it soon.

I searched the documentation about what the global folder contains and found out that these contain cluster-wide tables like the list of databases, etc.

I wanted not to lose the latest transactions by restoring a backup. Now the question is this, is it ok to just copy the global folder from my backup 2 days ago, and replace the one in my current data folder? I'm very very sure no DDL statements were executed or no new databases/other objects were created since my last backup. Only DML statements were executed on the user's databases. Will I lose data if I do this?

________________________________________________________________
Sent via the WebMail system at primesoft.ph


Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joshua D. Drake 2008-03-04 05:43:02 Re: pg_dump additional options for performance
Previous Message Brendan Jurd 2008-03-04 03:15:53 Re: [GENERAL] Empty arrays with ARRAY[]