diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
new file mode 100644
index 33720e8..e606602
*** a/src/backend/tcop/postgres.c
--- b/src/backend/tcop/postgres.c
*************** finish_xact_command(void)
*** 2460,2465 ****
--- 2460,2468 ----
  		/* Cancel any active statement timeout before committing */
  		disable_timeout(STATEMENT_TIMEOUT, false);
  
+ 		/* ignore cancel coming from the client */
+ 		HOLD_CANCEL_INTERRUPTS();
+ 
  		/* Now commit the command */
  		ereport(DEBUG3,
  				(errmsg_internal("CommitTransactionCommand")));
*************** finish_xact_command(void)
*** 2477,2482 ****
--- 2480,2488 ----
  		MemoryContextStats(TopMemoryContext);
  #endif
  
+ 		QueryCancelPending = false;
+ 		RESUME_CANCEL_INTERRUPTS();
+ 
  		xact_started = false;
  	}
  }
