diff options
Diffstat (limited to 'src/backend/access/transam/parallel.c')
-rw-r--r-- | src/backend/access/transam/parallel.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/backend/access/transam/parallel.c b/src/backend/access/transam/parallel.c index 8613fc6fb54..b9cf197d353 100644 --- a/src/backend/access/transam/parallel.c +++ b/src/backend/access/transam/parallel.c @@ -1410,10 +1410,6 @@ 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. */ @@ -1456,6 +1452,14 @@ 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. |