diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c index 3d80ff9e5b..0497332e9d 100644 --- a/src/backend/catalog/heap.c +++ b/src/backend/catalog/heap.c @@ -3298,6 +3298,9 @@ StorePartitionBound(Relation rel, Relation parent, PartitionBoundSpec *bound) heap_freetuple(newtuple); heap_close(classRel, RowExclusiveLock); + /* Make update visible */ + CommandCounterIncrement(); + /* * The partition constraint for the default partition depends on the * partition bounds of every other partition, so we must invalidate the diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c index ff40683d06..0a2ab50023 100644 --- a/src/backend/commands/indexcmds.c +++ b/src/backend/commands/indexcmds.c @@ -2512,5 +2512,8 @@ IndexSetParentIndex(Relation partitionIdx, Oid parentOid) recordDependencyOn(&partIdx, &partitionTbl, DEPENDENCY_AUTO); } + + /* make our updates visible */ + CommandCounterIncrement(); } } diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 218224a156..8f83aa4675 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -864,13 +864,6 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, update_default_partition_oid(RelationGetRelid(parent), relationId); heap_close(parent, NoLock); - - /* - * The code that follows may also update the pg_class tuple to update - * relnumchecks, so bump up the command counter to avoid the "already - * updated by self" error. - */ - CommandCounterIncrement(); } /* @@ -14585,8 +14578,6 @@ ATExecAttachPartitionIdx(List **wqueue, Relation parentIdx, RangeVar *name) pfree(attmap); - CommandCounterIncrement(); - validatePartitionedIndex(parentIdx, parentTbl); }