diff --git a/src/backend/access/heap/tuptoaster.c b/src/backend/access/heap/tuptoaster.c index 55d6e91d1c..3a9d2ff38e 100644 --- a/src/backend/access/heap/tuptoaster.c +++ b/src/backend/access/heap/tuptoaster.c @@ -1436,8 +1436,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); - table_close(toastrel, lock); + toast_close_indexes(toastidxs, num_indexes, NoLock); + table_close(toastrel, NoLock); return validIndexOid; } diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index ebaec4f8dd..c7fda21634 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -1490,7 +1490,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",