diff options
author | Tomas Vondra <tomas.vondra@postgresql.org> | 2019-01-22 23:11:17 +0100 |
---|---|---|
committer | Tomas Vondra <tomas.vondra@postgresql.org> | 2019-01-22 23:11:17 +0100 |
commit | 4a8283d0ec5a6781b9e0d4ba16b44da8a0856d02 (patch) | |
tree | 2ee96ab66a882847fae278d001930af5a6033bc2 /src | |
parent | 005881033d4e34c0b2e0a157464dc1929db52e17 (diff) | |
download | postgresql-4a8283d0ec5a6781b9e0d4ba16b44da8a0856d02.tar.gz postgresql-4a8283d0ec5a6781b9e0d4ba16b44da8a0856d02.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/commands/copy.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c index c410e0a0dd6..03745cca753 100644 --- a/src/backend/commands/copy.c +++ b/src/backend/commands/copy.c @@ -2612,8 +2612,7 @@ CopyFrom(CopyState cstate) */ insertMethod = CIM_SINGLE; } - else if (cstate->whereClause != NULL || - contain_volatile_functions(cstate->whereClause)) + else if (contain_volatile_functions(cstate->whereClause)) { /* * Can't support multi-inserts if there are any volatile funcation |