File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -683,9 +683,6 @@ merge_range_partitions(PG_FUNCTION_ARGS)
683683 /* Extract partition Oids from array */
684684 parts [i ] = DatumGetObjectId (datums [i ]);
685685
686- /* Prevent modification of partitions */
687- LockRelationOid (parts [i ], AccessExclusiveLock );
688-
689686 /* Check if all partitions are from the same parent */
690687 cur_parent = get_parent_of_partition (parts [i ]);
691688
@@ -708,6 +705,10 @@ merge_range_partitions(PG_FUNCTION_ARGS)
708705 /* Prevent changes in partitioning scheme */
709706 LockRelationOid (parent , ShareUpdateExclusiveLock );
710707
708+ /* Prevent modification of partitions */
709+ for (i = 0 ; i < nparts ; i ++ )
710+ LockRelationOid (parts [i ], AccessExclusiveLock );
711+
711712 /* Emit an error if it is not partitioned by RANGE */
712713 prel = get_pathman_relation_info (parent );
713714 shout_if_prel_is_invalid (parent , prel , PT_RANGE );
You can’t perform that action at this time.
0 commit comments