We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parente57e04d commit1daee0cCopy full SHA for 1daee0c
src/pl_range_funcs.c
@@ -683,9 +683,6 @@ merge_range_partitions(PG_FUNCTION_ARGS)
683
/* Extract partition Oids from array */
684
parts[i]=DatumGetObjectId(datums[i]);
685
686
-/* Prevent modification of partitions */
687
-LockRelationOid(parts[i],AccessExclusiveLock);
688
-
689
/* Check if all partitions are from the same parent */
690
cur_parent=get_parent_of_partition(parts[i]);
691
@@ -708,6 +705,10 @@ merge_range_partitions(PG_FUNCTION_ARGS)
708
705
/* Prevent changes in partitioning scheme */
709
706
LockRelationOid(parent,ShareUpdateExclusiveLock);
710
707
+/* Prevent modification of partitions */
+for (i=0;i<nparts;i++)
+LockRelationOid(parts[i],AccessExclusiveLock);
711
+
712
/* Emit an error if it is not partitioned by RANGE */
713
prel=get_pathman_relation_info(parent);
714
shout_if_prel_is_invalid(parent,prel,PT_RANGE);