Re: [HACKERS] deadlock in REINDEX

2003-02-18 Thread Olleg Samoylov
On Tue, 18 Feb 2003, Gavin Sherry wrote: GS>Perhaps the change that needs to be made is: GS> GS>if(IsUnderPostmaster) GS> elog(ERROR,"You cannot run REINDEX INDEX in multi-user mode"); GS> GS>to ReindexIndex() or some other appropriate place (with a better error GS>message). GS> GS>Gavin It i

Re: [HACKERS] deadlock in REINDEX

2003-02-17 Thread Gavin Sherry
On Mon, 17 Feb 2003, Tom Lane wrote: > Neil Conway <[EMAIL PROTECTED]> writes: > > On Mon, 2003-02-17 at 18:39, Tom Lane wrote: > >> If you release the lock then I think you are opening yourself to worse > >> troubles than this one, having to do with someone renaming/deleting the > >> table and/or

Re: [HACKERS] deadlock in REINDEX

2003-02-17 Thread Tom Lane
Neil Conway <[EMAIL PROTECTED]> writes: > On Mon, 2003-02-17 at 18:39, Tom Lane wrote: >> If you release the lock then I think you are opening yourself to worse >> troubles than this one, having to do with someone renaming/deleting the >> table and/or index out from under you. > Presumably, the re

Re: [HACKERS] deadlock in REINDEX

2003-02-17 Thread Neil Conway
On Mon, 2003-02-17 at 18:39, Tom Lane wrote: > > I was thinking of changing reindex_index() to acquire an AccessShareLock > > on the index in question, find its parent rel ID, release the lock, then > > acquire an AccessExclusiveLock on the parent rel, followed by an > > AccessExclusiveLock on the

Re: [HACKERS] deadlock in REINDEX

2003-02-17 Thread Tom Lane
Neil Conway <[EMAIL PROTECTED]> writes: > Naturally, this situation is not a very common one. But it seems to me > that the practice of acquiring locks in REINDEX in an inconsistent order > is asking for trouble: REINDEX TABLE locks the heap rel first, followed > by any indexes of the heap rel, but