]> granicus.if.org Git - postgresql/commitdiff
I think reindex_index had better get AccessExclusiveLock on the parent
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 3 Sep 2002 16:00:02 +0000 (16:00 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 3 Sep 2002 16:00:02 +0000 (16:00 +0000)
heap, not just ExclusiveLock.

src/backend/catalog/index.c

index 489d1c607ea7025e1b94e62b31e24ac3803a3f3a..f91600f94a8a0a81a413d6f2995df6206df83a05 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.194 2002/09/03 01:04:41 tgl Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.195 2002/09/03 16:00:02 tgl Exp $
  *
  *
  * INTERFACE ROUTINES
@@ -1818,7 +1818,7 @@ reindex_index(Oid indexId, bool force, bool inplace)
        indexInfo = BuildIndexInfo(iRel->rd_index);
 
        /* Open the parent heap relation */
-       heapRelation = heap_open(heapId, ExclusiveLock);
+       heapRelation = heap_open(heapId, AccessExclusiveLock);
        if (heapRelation == NULL)
                elog(ERROR, "reindex_index: can't open heap relation");
 
@@ -1919,8 +1919,8 @@ reindex_relation(Oid relid, bool force)
 
        /*
         * Ensure to hold an exclusive lock throughout the transaction. The
-        * lock could be less intensive but now it's AccessExclusiveLock for
-        * simplicity.
+        * lock could be less intensive (in the non-overwrite path) but now
+        * it's AccessExclusiveLock for simplicity.
         */
        rel = heap_open(relid, AccessExclusiveLock);