Re: psql hangs when trying to access a database

From: Mark Nickel <mnickel(at)dunsirn(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: psql hangs when trying to access a database
Date: 2001-11-06 05:31:20
Message-ID: 3BE775A8.A11524D0@dunsirn.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> away. If there's a corrupted index, you can use REINDEX DATABASE
> to rebuild it --- but read the directions carefully! You need to do
> it in a properly-started standalone backend, else you'll not get
> far enough to do the reindex.
>

bingo! Corrupted index it was!

The problem was solved, as you said, by starting a standalone backend:
/usr/bin/postgres -d2 -B 24576 -D /db/pgsql -O -P datawarehouse

Once I was in, I performed a
REINDEX DATABASE datawarehouse FORCE;

for good measure I ran a VACUUM and was treated to several errors
requesting me to recreate indices.

Running REINDEX TABLE <table name>... REINDEX INDEX <index name> on those
objects that VACUUM reported as needed to be recreated fixed all of my
problems.

For good measure I ran a vacuumdb datawarehouse as the postgres super
user, after bringing the database up with pg_ctl, and all is well.

thankyou thankyou thankyou! You've helped me to dramatically increase my
knowledge of this database. I recognized the REINDEX command from the
manual, but I really didn't know the appropiate time to use such a
command. In "normal" daily database use, your indices don't get
corrupted. Thanks for helping me to discover when to use this command!
:)

Would having the --enable-debug in the build of postgres have helped to
show more information in the stack trace? Would that extra information
been more helpful to determining the problem in this case?

While waiting for majordomo to send your replies, I built a --enable-debug
version of postgres from the 7.1 SRPM just in case the REINDEX didn't
work. Fortunately I can just stash those RPM's away for a rainy day... :)

I'm off to plan an upgrade to 7.1.3 :)
Mark Nickel

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Micah Yoder 2001-11-06 05:45:35 Re: Sourceforge moving from PostgreSQL to Oracle
Previous Message Andrew Gould 2001-11-06 05:21:00 Re: deleted logs when I shouldn't have...