aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/async.c
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2015-10-22 10:49:20 -0400
committerRobert Haas <rhaas@postgresql.org>2015-10-22 10:49:20 -0400
commitbde39eed0cafb82bc94c40e95d96b5cf47b6f719 (patch)
treef7953cad3331f41078886d4811b2efec02a4d0d8 /src/backend/commands/async.c
parent1a219fa15bf802d69621e71c43d1a09515bcdc50 (diff)
downloadpostgresql-bde39eed0cafb82bc94c40e95d96b5cf47b6f719.tar.gz
postgresql-bde39eed0cafb82bc94c40e95d96b5cf47b6f719.zip
Fix a couple of bugs in recent parallelism-related commits.
Commit 816e336f12ecabdc834d4cc31bcf966b2dd323dc added the wrong error check to async.c; sending restrictions is restricted to the leader, not altogether unsafe. Commit 3bd909b220930f21d6e15833a17947be749e7fde added ExecShutdownNode to traverse the planstate tree and call shutdown functions, but made a Gather node, the only node that actually has such a function, abort the tree traversal, which is wrong.
Diffstat (limited to 'src/backend/commands/async.c')
-rw-r--r--src/backend/commands/async.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/backend/commands/async.c b/src/backend/commands/async.c
index 3657d693bf8..5059e3de927 100644
--- a/src/backend/commands/async.c
+++ b/src/backend/commands/async.c
@@ -117,6 +117,7 @@
#include <unistd.h>
#include <signal.h>
+#include "access/parallel.h"
#include "access/slru.h"
#include "access/transam.h"
#include "access/xact.h"
@@ -544,8 +545,8 @@ Async_Notify(const char *channel, const char *payload)
Notification *n;
MemoryContext oldcontext;
- if (IsInParallelMode())
- elog(ERROR, "cannot send notifications during a parallel operation");
+ if (IsParallelWorker())
+ elog(ERROR, "cannot send notifications from a parallel worker");
if (Trace_notify)
elog(DEBUG1, "Async_Notify(%s)", channel);