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

Commit 4a8283d

Browse files
committed
Fix handling of volatile expressions in COPY FROM ... WHERE
The checking for calls to volatile functions in the COPY FROM ... WHERE expression was treating all WHERE clauses as if containing such calls. While that does not produce incorrect results, this disables batching which may result in significant performance regression. Discussion: https://www.postgresql.org/message-id/flat/CALAY4q_DdpWDuB5-Zyi-oTtO2uSk8pmy+dupiRe3AvAc++1imA@mail.gmail.com
1 parent 0058810 commit 4a8283d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/backend/commands/copy.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -2612,8 +2612,7 @@ CopyFrom(CopyState cstate)
26122612
*/
26132613
insertMethod = CIM_SINGLE;
26142614
}
2615-
else if (cstate->whereClause != NULL ||
2616-
contain_volatile_functions(cstate->whereClause))
2615+
else if (contain_volatile_functions(cstate->whereClause))
26172616
{
26182617
/*
26192618
* Can't support multi-inserts if there are any volatile funcation

0 commit comments

Comments
 (0)