diff options
author | Andres Freund <andres@anarazel.de> | 2017-06-02 19:05:57 -0700 |
---|---|---|
committer | Andres Freund <andres@anarazel.de> | 2017-06-02 19:11:15 -0700 |
commit | 34aebcf42a70089b76ff8e9ccda331f111153eeb (patch) | |
tree | f760f5fc95b20bfa623b7297810a7a759a22db46 | |
parent | de492c17f064ea3ddcb73d9529f3e30a1483ffa5 (diff) | |
download | postgresql-34aebcf42a70089b76ff8e9ccda331f111153eeb.tar.gz postgresql-34aebcf42a70089b76ff8e9ccda331f111153eeb.zip |
Allow parallelism in COPY (query) TO ...;
Previously this was not allowed, as copy.c didn't set the
CURSOR_OPT_PARALLEL_OK flag when planning the query. Set it.
While the lack of parallel query for COPY isn't strictly speaking a
bug, it does prevent parallelism from being used in a facility
commonly used to run long running queries. Thus backpatch to 9.6.
Author: Andres Freund
Discussion: https://postgr.es/m/20170531231958.ihanapplorptykzm@alap3.anarazel.de
Backpatch: 9.6, where parallelism was introduced.
-rw-r--r-- | src/backend/commands/copy.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c index 84b1a54cb9b..810bae5dadc 100644 --- a/src/backend/commands/copy.c +++ b/src/backend/commands/copy.c @@ -1527,7 +1527,7 @@ BeginCopy(ParseState *pstate, } /* plan the query */ - plan = pg_plan_query(query, 0, NULL); + plan = pg_plan_query(query, CURSOR_OPT_PARALLEL_OK, NULL); /* * With row level security and a user using "COPY relation TO", we |