Index: src/backend/storage/lmgr/proc.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v
retrieving revision 1.163
diff -c -c -r1.163 proc.c
*** src/backend/storage/lmgr/proc.c	20 Aug 2005 23:26:24 -0000	1.163
--- src/backend/storage/lmgr/proc.c	9 Sep 2005 11:28:39 -0000
***************
*** 51,57 ****
  #include "storage/proc.h"
  #include "storage/procarray.h"
  #include "storage/spin.h"
! 
  
  /* GUC variables */
  int			DeadlockTimeout = 1000;
--- 51,58 ----
  #include "storage/proc.h"
  #include "storage/procarray.h"
  #include "storage/spin.h"
! #include "tcop/tcopprot.h"
! #include "utils/elog.h"
  
  /* GUC variables */
  int			DeadlockTimeout = 1000;
***************
*** 1179,1184 ****
--- 1180,1196 ----
  	{
  		/* Time to die */
  		statement_timeout_active = false;
+ 
+         /* 
+          * Log the statement that has timed out, unless we already have
+          * log_min_error_statement set low enough that we will log the
+          * query as part of the handling for the kill() 
+          */
+         if (log_min_error_statement > WARNING)
+        		ereport(LOG,
+         		(errmsg("timeout cancels statement: %s",
+ 						debug_query_string ? debug_query_string : "")));
+ 
  		kill(MyProcPid, SIGINT);
  	}
  	else
