diff --git a/src/backend/executor/nodeWindowAgg.c b/src/backend/executor/nodeWindowAgg.c
index 51a6708a39..ec13a9e030 100644
--- a/src/backend/executor/nodeWindowAgg.c
+++ b/src/backend/executor/nodeWindowAgg.c
@@ -2206,9 +2206,11 @@ ExecWindowAgg(PlanState *pstate)
 		 */
 		spool_tuples(winstate, winstate->currentpos);
 
-		/* Move to the next partition if we reached the end of this partition */
+		/* Move to the next partition if we reached the end of this partition or
+		 * if we are in STRICT pass-through mode */
 		if (winstate->partition_spooled &&
-			winstate->currentpos >= winstate->spooled_rows)
+			(winstate->currentpos >= winstate->spooled_rows ||
+			 winstate->status == WINDOWAGG_PASSTHROUGH_STRICT))
 		{
 			release_partition(winstate);
 
-- 
2.34.1
