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.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/backend/access/transam/parallel.c b/src/backend/access/transam/parallel.c
index d5bee10cd4b..df0cd775588 100644
--- a/src/backend/access/transam/parallel.c
+++ b/src/backend/access/transam/parallel.c
@@ -1402,6 +1402,10 @@ ParallelWorkerMain(Datum main_arg)
libraryspace = shm_toc_lookup(toc, PARALLEL_KEY_LIBRARY, false);
StartTransactionCommand();
RestoreLibraryState(libraryspace);
+
+ /* Restore GUC values from launching backend. */
+ gucspace = shm_toc_lookup(toc, PARALLEL_KEY_GUC, false);
+ RestoreGUCState(gucspace);
CommitTransactionCommand();
/* Crank up a transaction state appropriate to a parallel worker. */
@@ -1444,14 +1448,6 @@ ParallelWorkerMain(Datum main_arg)
InvalidateSystemCaches();
/*
- * Restore GUC values from launching backend. We can't do this earlier,
- * because GUC check hooks that do catalog lookups need to see the same
- * database state as the leader.
- */
- gucspace = shm_toc_lookup(toc, PARALLEL_KEY_GUC, false);
- RestoreGUCState(gucspace);
-
- /*
* Restore current role id. Skip verifying whether session user is
* allowed to become this role and blindly restore the leader's state for
* current role.