Page 1 of 1

damage? - error message

PostPosted: Tue Jun 17, 2008 5:14 am
by moppo
Hello, I got an error message when importing hands from Ipoker yesterday and it seemed to have damaged my PT database since I can“t even compress the database, visit database maintenance and options or delete the session without getting the same message. My PT error log says:

*********************************
PT Version: 2.17.01k
Error Date: 06/17/2008 00:45
Database Error: 7
Error Text: Select error: SQLSTATE = XX000
ERROR: could not read block 2035 of relation 1663/18155/18210: Invalid argument;
Error while executing the query
DataObject: d_sessions
Syntax In Error: SELECT session.session_id , session.player_id , session.session_start , session.session_end , session.table_name , session.seat_number , session.session_notes , session.game_level_id , session.amount_won , session.total_hands , session.site_id , session.vol_saw_flop , session.pre_flop_raise , session.att_steal , session.chance_to_steal , session.won_hand , session.went_to_sd , session.won_at_sd , session.real_player_id , session.cur_ind , session.exrate FROM session WHERE ( session.player_id = 13865 ) and ( session.site_id = 15 )
*********************************

Help, would greatly be appreciated!

Re: damage? - error message

PostPosted: Tue Jun 17, 2008 8:22 am
by ptrack pat
You can try reindexing as detailed here
http://www.pokertracker3.com/forums/arc ... ex+pgadmin

You can just reindex the SESSION table as that is the one causing the error.

Re: damage? - error message

PostPosted: Tue Jun 17, 2008 9:34 am
by moppo
So I tried reindexing the SESSION table and got:

ERROR: could not read block 2035 of relation 1663/18155/18210: Invalid argument

... and then pgadminIII crashed!

I have made no backup of my database and it has around 100K played hands. What do I do now? Should I export everything except the session/day causing me problems. Start a new DB and then import again? (should I discard observed hands? would guess I have more then a million observed hands) Or what do I do?

Re: damage? - error message

PostPosted: Tue Jun 17, 2008 10:18 am
by ptrack pat
I doubt it's one session causing this problem, it sounds like the db is corrupted, why haven't you been doing backups?

When did you convert this database to PostgreSQL?

Re: damage? - error message

PostPosted: Tue Jun 17, 2008 10:40 am
by moppo
I converted the DB in the beginning before playing a hand. So is there no way to salvage the DB? I can still click on "ring games" and see every hand played played (except a few hands lost from that latest session). I would just want a DB where I can do a vacuum or enter the DB maintenance without the computer/software stalling and me being prompted with error messages.

Re: damage? - error message

PostPosted: Tue Jun 17, 2008 10:58 am
by ptrack pat
If you haven't backed up this database and the reindex didn't work then it's corrupted beyond repair and with no backups you have nothing to revert back to.

So you should either start a new database. If you want all these hands in the current db to be in the new one you will have to use Utilities > Export Hand Histories To File option to export the hands to text files which you can use to import into the new db. With that many hands, it's going to take a long time to reimport them all.

Re: damage? - error message

PostPosted: Tue Jun 17, 2008 11:21 am
by moppo
Looking back, its closer to 80K hands. I think I will give it a try, exporting and importing them.

Is there a risk I will be exporting the corrupt info and by accident importing that to the new DB ? (destroying the new DB too)

Re: damage? - error message

PostPosted: Tue Jun 17, 2008 2:21 pm
by ptrack pat
Is there a risk I will be exporting the corrupt info and by accident importing that to the new DB ? (destroying the new DB too)


No, the problem isn't with the hand histories, there is an issue with the database, in particular, that one table. But the hand history text isn't what caused it. If you are able to successfully export the hands without getting errors too then importing into a new database shouldn't be a problem. Just make sure you start doing regular backups that way if there is a problem in the future you won't have to do all this again.

Re: damage? - error message

PostPosted: Wed Jun 18, 2008 5:52 am
by moppo
So, I thought I just post a conclusion to this thread.

I exported all hands (took a few minutes) and imported them into a new DB (350K hands took 8-10 hours!).
I deleted the old DB and made a backup of the new one.
And everything works.

Good luck everyone!