pgmonitor query global variable - Mailing list pgsql-patches

From Bruce Momjian
Subject pgmonitor query global variable
Date
Msg-id 200104141912.PAA27393@candle.pha.pa.us
Whole thread Raw
List pgsql-patches
I have just applied the following patch for pgmonitor query display and
debugging use.  It holds the current query string.  It will appear in
7.1.1.


--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
Index: src/backend/tcop/postgres.c
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/src/backend/tcop/postgres.c,v
retrieving revision 1.215
diff -c -r1.215 postgres.c
*** src/backend/tcop/postgres.c    2001/03/23 18:26:01    1.215
--- src/backend/tcop/postgres.c    2001/03/25 00:17:09
***************
*** 74,79 ****
--- 74,81 ----
  extern int    optind;
  extern char *optarg;

+ char *debug_query_string;        /* used by pgmonitor */
+
  /*
   * for ps display
   */
***************
*** 615,620 ****
--- 617,624 ----
      List       *parsetree_list,
                 *parsetree_item;

+     debug_query_string = query_string;    /* used by pgmonitor */
+
      /*
       * Start up a transaction command.    All queries generated by the
       * query_string will be in this same command block, *unless* we find a
***************
*** 853,858 ****
--- 857,864 ----
       */
      if (xact_started)
          finish_xact_command();
+
+     debug_query_string = NULL;        /* used by pgmonitor */
  }

  /*
***************
*** 1729,1735 ****

      if (sigsetjmp(Warn_restart, 1) != 0)
      {
-
          /*
           * NOTE: if you are tempted to add more code in this if-block,
           * consider the probability that it should be in
--- 1735,1740 ----
***************
*** 1744,1749 ****
--- 1749,1755 ----
          QueryCancelPending = false;
          InterruptHoldoffCount = 1;
          CritSectionCount = 0;    /* should be unnecessary, but... */
+         debug_query_string = NULL;        /* used by pgmonitor */

          /*
           * Make sure we are in a valid memory context during recovery.

pgsql-patches by date:

Previous
From: Patrick Welche
Date:
Subject: Re: Call for platforms
Next
From: Richard Scranton
Date:
Subject: FreeBSD 4.1 and JDK 1.1.8 compile problems