REINDEXing user table in non stand-alone?
REINDEXing user table in non stand-alone?
От:
"Shuzo Kubo" <gardenweasel@hotmail.com>
Дата:
Hi,
I read the manual for the REINDEX command.
The REINDEX command is described as
"Recover corrupted system indexes under
stand-alone Postgres "
I am currently trying to reindex an user table.
Does one need to go into stand-alone mode to
reindex an user table?
I have actually REINDEXed an user table when
the database is not in stand-alone mode. It
seems fine but the test environment does not
have much users accessing it, the live site that
I eventually want to REINDEX does.
Is it safe to REINDEX an user table while in
non stand-alone mode when other users are
accessing it?
Thank you in advance.
Re: REINDEXing user table in non stand-alone?
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
"Shuzo Kubo" writes: > Does one need to go into stand-alone mode to > reindex an user table? No. The docs need some improvement in this area. The pushups mentioned in the docs are really only necessary if you have a broken system index that's sufficiently critical that the backend crashes before you can execute REINDEX. (For instance, the indexes on pg_class are likely to cause such problems.) The basic idea of the pushups is to start the backend in a mode such that it doesn't use the indexes to access the system catalogs. > Is it safe to REINDEX an user table while in > non stand-alone mode when other users are > accessing it? Not sure about that --- I believe it's safe in 7.2, but IIRC, REINDEX didn't bother to acquire a LOCK on the table in earlier releases. Best to shut down any other clients that might be trying to access the damaged table. Or forget REINDEX and recover via DROP/CREATE INDEX. regards, tom lane