diff --git a/src/backend/access/heap/tuptoaster.c b/src/backend/access/heap/tuptoaster.c index e3d09db0a85..04edfda5b41 100644 --- a/src/backend/access/heap/tuptoaster.c +++ b/src/backend/access/heap/tuptoaster.c @@ -1447,8 +1447,8 @@ toast_get_valid_index(Oid toastoid, LOCKMODE lock) validIndexOid = RelationGetRelid(toastidxs[validIndex]); /* Close the toast relation and all its indexes */ - toast_close_indexes(toastidxs, num_indexes, lock); - heap_close(toastrel, lock); + toast_close_indexes(toastidxs, num_indexes, NoLock); + heap_close(toastrel, NoLock); return validIndexOid; } diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index fe2d4f147d7..69dbaf3b8d4 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -1636,7 +1636,7 @@ finish_heap_swap(Oid OIDOldHeap, Oid OIDNewHeap, /* Get the associated valid index to be renamed */ toastidx = toast_get_valid_index(newrel->rd_rel->reltoastrelid, - AccessShareLock); + NoLock); /* rename the toast table ... */ snprintf(NewToastName, NAMEDATALEN, "pg_toast_%u",