summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/access/transam/parallel.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/backend/access/transam/parallel.c b/src/backend/access/transam/parallel.c
index 9de52395244..82b2f3e1466 100644
--- a/src/backend/access/transam/parallel.c
+++ b/src/backend/access/transam/parallel.c
@@ -1149,15 +1149,6 @@ ParallelWorkerMain(Datum main_arg)
return;
/*
- * Load libraries that were loaded by original backend. We want to do
- * this before restoring GUCs, because the libraries might define custom
- * variables.
- */
- libraryspace = shm_toc_lookup(toc, PARALLEL_KEY_LIBRARY);
- Assert(libraryspace != NULL);
- RestoreLibraryState(libraryspace);
-
- /*
* Identify the entry point to be called. In theory this could result in
* loading an additional library, though most likely the entry point is in
* the core backend or in a library we just loaded.
@@ -1186,10 +1177,19 @@ ParallelWorkerMain(Datum main_arg)
*/
SetClientEncoding(GetDatabaseEncoding());
+ /*
+ * Load libraries that were loaded by original backend. We want to do
+ * this before restoring GUCs, because the libraries might define custom
+ * variables.
+ */
+ libraryspace = shm_toc_lookup(toc, PARALLEL_KEY_LIBRARY);
+ Assert(libraryspace != NULL);
+ StartTransactionCommand();
+ RestoreLibraryState(libraryspace);
+
/* Restore GUC values from launching backend. */
gucspace = shm_toc_lookup(toc, PARALLEL_KEY_GUC);
Assert(gucspace != NULL);
- StartTransactionCommand();
RestoreGUCState(gucspace);
CommitTransactionCommand();