Postgres DB table recovery

0

1

I was using PG Admin and modifying a table in my DB. I was actually adding two fields.

Once done, I hit the OK button and PG Admin hung up. I think this is the first time.

Now I cannot open that specific table through PG Admin. I'm not sure if this is corrupt.

How can I recover this or repair it?

Thanks!

OS: Ubuntu 12.04 Desktop version

EDIT: Each time I try to open it, PG Admin hangs and I have to force-quit it.

itsols

Posted 2013-10-21T11:33:05.910

Reputation: 305

I would log in using psql and see what became of the table. – Peter Eisentraut – 2013-10-21T20:26:48.827

@PeterEisentraut Thanks for your input. I can login now using pgAdmin and also the changes I was making were also updated despite the crash. If I recall this is the first time PG ever crashed on my system. – itsols – 2013-10-22T02:45:30.637

And my problem is BACK! I cannot even right-click the table to select an option. – itsols – 2013-10-27T14:56:57.190

I think this is a bug on PGAdmin. It is ok now after a system restart. – itsols – 2013-10-27T15:17:11.077

Answers

0

I'm not sure if this is the best way to get about it but here's what I did to fix the issue.

  1. Open PGAdmin
  2. Right click the table and from the menu select MAINTENANCE
  3. Clicked on Vacuum and under vacuuming options I took full vacuum.

In addition, I did 'reset table statistics'.

Now it seems ok.

itsols

Posted 2013-10-21T11:33:05.910

Reputation: 305