Index: src/backend/access/transam/xact.c
===================================================================
RCS file: /repositories/postgreshome/cvs/pgsql/src/backend/access/transam/xact.c,v
retrieving revision 1.269
diff -c -p -r1.269 xact.c
*** src/backend/access/transam/xact.c	19 Nov 2008 10:34:50 -0000	1.269
--- src/backend/access/transam/xact.c	3 Dec 2008 12:47:35 -0000
*************** CommitTransaction(void)
*** 1685,1690 ****
--- 1685,1691 ----
  	smgrDoPendingDeletes(true);
  
  	AtEOXact_MultiXact();
+ 	AtEOXact_Snapshot(true);
  
  	ResourceOwnerRelease(TopTransactionResourceOwner,
  						 RESOURCE_RELEASE_LOCKS,
*************** CommitTransaction(void)
*** 1706,1712 ****
  	AtEOXact_ComboCid();
  	AtEOXact_HashTables(true);
  	AtEOXact_PgStat(true);
- 	AtEOXact_Snapshot(true);
  	pgstat_report_xact_timestamp(0);
  
  	CurrentResourceOwner = NULL;
--- 1707,1712 ----
Index: src/backend/utils/time/snapmgr.c
===================================================================
RCS file: /repositories/postgreshome/cvs/pgsql/src/backend/utils/time/snapmgr.c,v
retrieving revision 1.7
diff -c -p -r1.7 snapmgr.c
*** src/backend/utils/time/snapmgr.c	25 Nov 2008 20:28:29 -0000	1.7
--- src/backend/utils/time/snapmgr.c	3 Dec 2008 12:47:36 -0000
*************** GetTransactionSnapshot(void)
*** 136,142 ****
--- 136,145 ----
  		 */
  		if (IsXactIsoLevelSerializable)
  		{
+ 			ResourceOwner oldowner = CurrentResourceOwner;
+ 			CurrentResourceOwner = TopTransactionResourceOwner;
  			CurrentSnapshot = RegisterSnapshot(CurrentSnapshot);
+ 			CurrentResourceOwner = oldowner;
  			registered_serializable = true;
  		}
  
*************** AtEOXact_Snapshot(bool isCommit)
*** 480,486 ****
--- 483,494 ----
  		 * refcount to the serializable snapshot.
  		 */
  		if (registered_serializable)
+ 		{
+ 			ResourceOwner oldowner = CurrentResourceOwner;
+ 			CurrentResourceOwner = TopTransactionResourceOwner;
  			UnregisterSnapshot(CurrentSnapshot);
+ 			CurrentResourceOwner = oldowner;
+ 		}
  
  		if (RegisteredSnapshots != 0)
  			elog(WARNING, "%d registered snapshots seem to remain after cleanup",
