Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit f083afa

Browse files
author
Amit Kapila
committed
Fix comments in heapam.c.
After commits 85f6b49 and 3ba59cc, we can allow parallel inserts which was earlier not possible as parallel group members won't conflict for relation extension and page lock. In those commits, we forgot to update comments at few places. Author: Amit Kapila Reviewed-by: Robert Haas and Dilip Kumar Backpatch-through: 13 Discussion: https://postgr.es/m/CAFiTN-tMrQh5FFMPx5aWJ+1gi1H6JxktEhq5mDwCHgnEO5oBkA@mail.gmail.com
1 parent 0abd9cd commit f083afa

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/backend/access/heap/heapam.c

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2013,12 +2013,10 @@ heap_prepare_insert(Relation relation, HeapTuple tup, TransactionId xid,
20132013
CommandId cid, int options)
20142014
{
20152015
/*
2016-
* Parallel operations are required to be strictly read-only in a parallel
2017-
* worker. Parallel inserts are not safe even in the leader in the
2018-
* general case, because group locking means that heavyweight locks for
2019-
* relation extension or GIN page locks will not conflict between members
2020-
* of a lock group, but we don't prohibit that case here because there are
2021-
* useful special cases that we can safely allow, such as CREATE TABLE AS.
2016+
* To allow parallel inserts, we need to ensure that they are safe to be
2017+
* performed in workers. We have the infrastructure to allow parallel
2018+
* inserts in general except for the cases where inserts generate a new
2019+
* CommandId (eg. inserts into a table having a foreign key column).
20222020
*/
20232021
if (IsParallelWorker())
20242022
ereport(ERROR,
@@ -5694,10 +5692,10 @@ heap_inplace_update(Relation relation, HeapTuple tuple)
56945692
uint32 newlen;
56955693

56965694
/*
5697-
* For now, parallel operations are required to be strictly read-only.
5698-
* Unlike a regular update, this should never create a combo CID, so it
5699-
* might be possible to relax this restriction, but not without more
5700-
* thought and testing. It's not clear that it would be useful, anyway.
5695+
* For now, we don't allow parallel updates. Unlike a regular update,
5696+
* this should never create a combo CID, so it might be possible to relax
5697+
* this restriction, but not without more thought and testing. It's not
5698+
* clear that it would be useful, anyway.
57015699
*/
57025700
if (IsInParallelMode())
57035701
ereport(ERROR,

0 commit comments

Comments
 (0)