On second thought, disable parallelism for prepared statements.
authorRobert Haas <rhaas@postgresql.org>
Fri, 26 Feb 2016 11:03:37 +0000 (16:33 +0530)
committerRobert Haas <rhaas@postgresql.org>
Fri, 26 Feb 2016 11:03:37 +0000 (16:33 +0530)
CREATE TABLE .. AS EXECUTE can turn an apparently read-only query into
a write operation, which parallel query can't handle.  It's a bit of a
shame that requires us to avoid parallel query for queries prepared via
PREPARE in all cases, but for right now it does.

src/backend/commands/prepare.c

index b01051df9d2f942d14a7d102fec97274f6342c05..cec37ce0405739d42732848ae08eef58dfa3daaa 100644 (file)
@@ -159,7 +159,7 @@ PrepareQuery(PrepareStmt *stmt, const char *queryString)
                       nargs,
                       NULL,
                       NULL,
-                      CURSOR_OPT_PARALLEL_OK,  /* allow parallel mode */
+                      0,       /* default cursor options */
                       true);   /* fixed result */
 
    /*