aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/copy.c
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2017-06-02 19:05:57 -0700
committerAndres Freund <andres@anarazel.de>2017-06-02 19:11:23 -0700
commit8a7cd781ee9486584c1262b0f8598b1162ceb73a (patch)
treea35777aa1ee5764bf4f4e7a00b20d8bd59115f10 /src/backend/commands/copy.c
parent8d9b4fe01b5e717ad85d3a3beeabf8e212524b04 (diff)
downloadpostgresql-8a7cd781ee9486584c1262b0f8598b1162ceb73a.tar.gz
postgresql-8a7cd781ee9486584c1262b0f8598b1162ceb73a.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.
Diffstat (limited to 'src/backend/commands/copy.c')
-rw-r--r--src/backend/commands/copy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c
index db6ef783145..41a828c2fe4 100644
--- a/src/backend/commands/copy.c
+++ b/src/backend/commands/copy.c
@@ -1491,7 +1491,7 @@ BeginCopy(bool is_from,
}
/* 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