Skip site navigation (1) Skip section navigation (2)

Re: reindexdb hangs

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: dx k9 <bitsandbytes88(at)hotmail(dot)com>, pgsql-admin(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: reindexdb hangs
Date: 2007-08-29 22:23:41
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-adminpgsql-hackers
Tom Lane wrote:

> > I examined cluster.c and it does seem to be missing a check too.  I'm
> > not sure where to add one though; the best choice would be the place
> > where the list of rels is built, but that scans only pg_index, so it
> > doesn't have access to the namespace of each rel.  So one idea would be
> > to get the pg_class row for each candidate, but that seems slow.
> > Another idea would be to just add all the candidates and silently skip
> > the temp indexes in cluster_rel.
> Yeah, an extra fetch of the pg_class row doesn't seem all that nice.
> I think you'd want to check it in approximately the same two places
> where pg_class_ownercheck() is applied (one for the 1-xact and one for
> the multi-xact path).

Actually, the 1-xact path does not need it, because the check is already
elsewhere.  We only need logic enough to skip temp tables silently while
building the list in the multi-xact path.  What this means is that very
few people, if any, clusters temp tables; because as soon as you do, a
plain CLUSTER command in another session errors out with

alvherre=# cluster;
ERROR:  cannot cluster temporary tables of other sessions

So, patch attached.

> Are there any other commands to be worried about?  I can't see any
> besides VACUUM/ANALYZE, and those seem covered.

I can't think of any.

Alvaro Herrera                      
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

Attachment: skiptemp.patch
Description: text/x-diff (3.2 KB)

In response to


pgsql-hackers by date

Next:From: Tom LaneDate: 2007-08-29 22:33:15
Subject: Re: [HACKERS] Contrib modules documentation online
Previous:From: Neil ConwayDate: 2007-08-29 22:22:11
Subject: Re: int8 & INT64_IS_BUSTED

pgsql-admin by date

Next:From: Tom LaneDate: 2007-08-29 23:05:26
Subject: Re: reindexdb hangs
Previous:From: Alvaro HerreraDate: 2007-08-29 21:54:40
Subject: Re: how to create dir using pg/plsql

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group