diff --git a/src/backend/access/transam/parallel.c b/src/backend/access/transam/parallel.c index 0b94c0f87e9..e09bdb20b0d 100644 --- a/src/backend/access/transam/parallel.c +++ b/src/backend/access/transam/parallel.c @@ -28,6 +28,7 @@ #include "tcop/tcopprot.h" #include "utils/combocid.h" #include "utils/guc.h" +#include "utils/inval.h" #include "utils/memutils.h" #include "utils/resowner.h" #include "utils/snapmgr.h" @@ -928,6 +929,12 @@ ParallelWorkerMain(Datum main_arg) Assert(asnapspace != NULL); PushActiveSnapshot(RestoreSnapshot(asnapspace)); + /* + * We've changed which tuples we can see, and must therefore invalidate + * system caches. + */ + InvalidateSystemCaches(); + /* Restore user ID and security context. */ SetUserIdAndSecContext(fps->current_user_id, fps->sec_context);