aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/transam/parallel.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/access/transam/parallel.c')
-rw-r--r--src/backend/access/transam/parallel.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/backend/access/transam/parallel.c b/src/backend/access/transam/parallel.c
index 8613fc6fb54..27551566ac4 100644
--- a/src/backend/access/transam/parallel.c
+++ b/src/backend/access/transam/parallel.c
@@ -1398,9 +1398,13 @@ ParallelWorkerMain(Datum main_arg)
/*
* Set the client encoding to the database encoding, since that is what
- * the leader will expect.
+ * the leader will expect. (We're cheating a bit by not calling
+ * PrepareClientEncoding first. It's okay because this call will always
+ * result in installing a no-op conversion. No error should be possible,
+ * but check anyway.)
*/
- SetClientEncoding(GetDatabaseEncoding());
+ if (SetClientEncoding(GetDatabaseEncoding()) < 0)
+ elog(ERROR, "SetClientEncoding(%d) failed", GetDatabaseEncoding());
/*
* Load libraries that were loaded by original backend. We want to do