Index: src/backend/tcop/postgres.c
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/src/backend/tcop/postgres.c,v
retrieving revision 1.155.2.1
diff -c -r1.155.2.1 postgres.c
*** src/backend/tcop/postgres.c	2000/08/30 21:19:32	1.155.2.1
--- src/backend/tcop/postgres.c	2001/03/25 00:26:47
***************
*** 130,135 ****
--- 130,137 ----
  char		pg_pathname[MAXPGPATH];
  FILE	   *StatFp = NULL;
  
+ char *debug_query_string;		/* used by pgmonitor */
+ 
  /* ----------------
   *		people who want to use EOF should #define DONTUSENEWLINE in
   *		tcop/tcopdebug.h
***************
*** 576,581 ****
--- 578,585 ----
  {
  	List	   *querytree_list;
  
+ 	debug_query_string = query_string;	/* used by pgmonitor */
+ 
  	/* parse and rewrite the queries */
  	querytree_list = pg_parse_and_rewrite(query_string, NULL, 0,
  										  aclOverride);
***************
*** 677,682 ****
--- 681,688 ----
  
  		CommandCounterIncrement();
  	}
+ 
+ 	debug_query_string = NULL;		/* used by pgmonitor */
  }
  
  /* --------------------------------
***************
*** 1472,1477 ****
--- 1478,1485 ----
  
  	if (sigsetjmp(Warn_restart, 1) != 0)
  	{
+ 		debug_query_string = NULL;		/* used by pgmonitor */
+ 
  		/* Make sure we are in a valid memory context */
  		MemoryContextSwitchTo(TopMemoryContext);
  
