diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c
new file mode 100644
index f55aa36..4c28c30
*** a/src/bin/pg_dump/pg_backup_archiver.c
--- b/src/bin/pg_dump/pg_backup_archiver.c
*************** RestoreArchive(Archive *AHX)
*** 721,726 ****
--- 721,729 ----
  	if (AH->public.verbose)
  		dumpTimestamp(AH, "Completed on", time(NULL));
  
+ 	/* Reset session in case we are included by another session */
+ 	ahprintf(AH, "--\n-- Reset session\n\nRESET ALL;\n\n");
+ 
  	ahprintf(AH, "--\n-- PostgreSQL database dump complete\n--\n\n");
  
  	/*
