It makes sense to do the CCIs in the places that do catalog updates,
rather than before the places that error out because the former ones
fail to do it. In particular, it looks like StorePartitionBound() and
IndexSetParentIndex() ought to make their own CCIs.
Per review comments from Peter Eisentraut for row-level triggers on
partitioned tables.
Discussion: https://postgr.es/m/
20171229225319[email protected]
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
recordDependencyOn(&partIdx, &partitionTbl, DEPENDENCY_AUTO);
}
+
+ /* make our updates visible */
+ CommandCounterIncrement();
}
}
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();
}
/*
pfree(attmap);
- CommandCounterIncrement();
-
validatePartitionedIndex(parentIdx, parentTbl);
}