PDA

View Full Version : One of the datafiles in my PostgreSQL folder got corrupted, need some help.



Eclipse86
02-17-2010, 10:01 PM
Hey guys,

Recently Windows started picking up bad blocks on my harddrive which I have postgreSQL installed on. I believe this is due to the fact that my HD might be dieing on me. I would see these bad block errors in the Windows event viewer whenever I did a vacuum/analyze of my HEM database. These bad block errors would increase in amount everytime I did another vacuum/anaylze. For example 2 weeks ago when it first appeared, windows reported 1 error with bad blocks. Then the second time I vacuum/anaylzed it reported 3 errors of bad blocks, and third time it recorded 9-10 errors of bad blocks.

As a result of this, I think vacuum/analyzing caused one of the data files in the PostgreSQL/8.3/data/base folder to become corrupted since it was trying to write or move this file to a part of the hard drive that had a bad sector. Either that or the database file in question was already corrupted due to it being written onto a bad sector of the HD in the first place, and the bad blocks errors I was getting in Windows was due to the fact that the vacuum/analyze procedure kept trying to move/analyze the corrupted file.

Attempts to copy this file to a different location failed. This file was about 853 mb, my total database is about 264 GB. So I decided to just delete this file to see if vacuum/analyzing would still cause Windows to report bad blocks in the event viewer.

My questions are,

1. How badly would it affect my database to delete this file?

2. Is each file in the Postgresql database independant of each other? For example, is the way the information is stored based on date? So if I deleted that file then I would just lose data on all hands I imported on a certain day, or a range of days?

Or is the information stored in such a way that if I deleted 1 file, it would delete all stats I have on a particular player?

Or is the information stored in such a way that if I deleted 1 file, it would delete certain stats on ALL players? For example, it might cause all my flop cbet % stats to dissapear on all players? etc.


Any help appreciated, thanks.

netsrak
02-18-2010, 08:24 AM
1. deleting a file in the postgresql data folder will very sure lead to a total data loss.

2. all the files are required and are connected

Don't touch any individual file in this folder, its all managed by the postgresql service

Eclipse86
02-18-2010, 07:08 PM
1. deleting a file in the postgresql data folder will very sure lead to a total data loss.

2. all the files are required and are connected

Don't touch any individual file in this folder, its all managed by the postgresql service

yep, surely enough deleting that file screwed up my entire database. I just tried to import some datamined hands and they all came up errors.

Not sure how postgresql was still able to function before I deleted that file though seeing as how the file was corrupted.