diff -cprN head/contrib/auto_explain/auto_explain.c auto_explain/contrib/auto_explain/auto_explain.c
*** head/contrib/auto_explain/auto_explain.c	2009-08-10 14:46:49.000000000 +0900
--- auto_explain/contrib/auto_explain/auto_explain.c	2009-08-20 11:58:40.334518429 +0900
***************
*** 12,17 ****
--- 12,18 ----
   */
  #include "postgres.h"
  
+ #include "access/xact.h"
  #include "commands/explain.h"
  #include "executor/instrument.h"
  #include "utils/guc.h"
*************** static ExecutorEnd_hook_type prev_Execut
*** 42,48 ****
  
  #define auto_explain_enabled() \
  	(auto_explain_log_min_duration >= 0 && \
! 	 (nesting_level == 0 || auto_explain_log_nested_statements))
  
  void		_PG_init(void);
  void		_PG_fini(void);
--- 43,50 ----
  
  #define auto_explain_enabled() \
  	(auto_explain_log_min_duration >= 0 && \
! 	 (nesting_level == 0 || auto_explain_log_nested_statements) && \
! 	 TransactionBlockStatusCode() == 'T')
  
  void		_PG_init(void);
  void		_PG_fini(void);
