diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c index 2968c7f7b7..495a114383 100644 --- a/src/backend/utils/time/snapmgr.c +++ b/src/backend/utils/time/snapmgr.c @@ -70,6 +70,7 @@ #include "utils/snapmgr.h" #include "utils/syscache.h" #include "utils/timestamp.h" +#include "tcop/pquery.h" /* @@ -992,7 +993,11 @@ AtSubAbort_Snapshot(int level) ActiveSnapshot = next; if (ActiveSnapshot == NULL) + { + if(ActivePortal) + ActivePortal->portalSnapshot = NULL; OldestActiveSnapshot = NULL; + } } SnapshotResetXmin();