Bruce Momjian wrote:
> Certainly we need to upgrade to an exclusive table lock to replace the
> heap table.
Well, we will be holding an ExclusiveLock on the heap relation
regardless. We "replace" the heap table by swapping its relfilenode, so
ISTM we needn't hold an AccessExclusiveLock.
> Do we want to get a shared lock and possibly starve waiting
> for an exclusive lock on the table to swap the new one in?
What I'm saying is that REINDEX on non-shared indexes need only acquire
an ExclusiveLock, and hence not need to escalate its lock.
-Neil