@@ -2044,12 +2044,10 @@ heap_prepare_insert(Relation relation, HeapTuple tup, TransactionId xid,
20442044 CommandId cid , int options )
20452045{
20462046 /*
2047- * Parallel operations are required to be strictly read-only in a parallel
2048- * worker. Parallel inserts are not safe even in the leader in the
2049- * general case, because group locking means that heavyweight locks for
2050- * relation extension or GIN page locks will not conflict between members
2051- * of a lock group, but we don't prohibit that case here because there are
2052- * useful special cases that we can safely allow, such as CREATE TABLE AS.
2047+ * To allow parallel inserts, we need to ensure that they are safe to be
2048+ * performed in workers. We have the infrastructure to allow parallel
2049+ * inserts in general except for the cases where inserts generate a new
2050+ * CommandId (eg. inserts into a table having a foreign key column).
20532051 */
20542052 if (IsParallelWorker ())
20552053 ereport (ERROR ,
@@ -5725,10 +5723,10 @@ heap_inplace_update(Relation relation, HeapTuple tuple)
57255723 uint32 newlen ;
57265724
57275725 /*
5728- * For now, parallel operations are required to be strictly read-only.
5729- * Unlike a regular update, this should never create a combo CID, so it
5730- * might be possible to relax this restriction, but not without more
5731- * thought and testing. It's not clear that it would be useful, anyway.
5726+ * For now, we don't allow parallel updates. Unlike a regular update,
5727+ * this should never create a combo CID, so it might be possible to relax
5728+ * this restriction, but not without more thought and testing. It's not
5729+ * clear that it would be useful, anyway.
57325730 */
57335731 if (IsInParallelMode ())
57345732 ereport (ERROR ,
0 commit comments