]> granicus.if.org Git - postgresql/commitdiff
Reduce printing from debug level 2 ande layout change.
authorBruce Momjian <bruce@momjian.us>
Sat, 7 Dec 1996 04:39:38 +0000 (04:39 +0000)
committerBruce Momjian <bruce@momjian.us>
Sat, 7 Dec 1996 04:39:38 +0000 (04:39 +0000)
src/backend/tcop/postgres.c
src/man/postgres.1

index 9faa69e4029fb7c6e7be51ef8e9a006c8a5dc0cc..be3aeb96f3759c426ecfe56bd589a62824db6af7 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.22 1996/11/27 13:47:05 momjian Exp $
+ *    $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.23 1996/12/07 04:39:06 momjian Exp $
  *
  * NOTES
  *    this is the "main" module of the postgres backend and
@@ -83,6 +83,7 @@
  *      global variables
  * ----------------
  */
+static bool     DebugPrintQuery = false;
 static bool     DebugPrintPlan = false;
 static bool     DebugPrintParse = false;
 static bool     DebugPrintRewrittenParsetree = false;
@@ -406,8 +407,13 @@ pg_plan(char *query_string,     /* string to execute */
             continue;
         }
         
+        if ( DebugPrintQuery == true ) {
+            printf("\n---- \tquery is:\n%s\n",query_string);
+            printf("\n");
+           fflush(stdout);
+        }
+        
         if ( DebugPrintParse == true ) {
-            printf("\ninput string is \"%s\"\n",query_string);
             printf("\n---- \tparser outputs :\n");
             nodeDisplay(querytree);
             printf("\n");
@@ -483,9 +489,7 @@ pg_plan(char *query_string,     /* string to execute */
     }
     
     if (DebugPrintRewrittenParsetree == true) {
-        printf("\n=================\n");
-        printf("  After Rewriting\n");
-        printf("=================\n");
+        printf("\n---- \tafter rewriting:\n");
 
         for (i=0; i<querytree_list->len; i++) {
             print(querytree_list->qtrees[i]);
@@ -534,7 +538,7 @@ pg_plan(char *query_string,     /* string to execute */
              * ----------------
              */
             if ( DebugPrintPlan == true ) {
-                printf("\nPlan is :\n");
+                printf("\n---- \tplan is :\n");
                 nodeDisplay(plan);
                 printf("\n");
             }
@@ -646,7 +650,7 @@ pg_eval_dest(char *query_string, /* string to execute */
              * ----------------
              */
             if ( DebugPrintPlan == true ) {
-                printf("\nPlan is :\n");
+                printf("\n---- plan is :\n");
                 nodeDisplay(plan);
                 printf("\n");
             }
@@ -884,10 +888,15 @@ PostgresMain(int argc, char *argv[])
             
         case 'd':   /* debug level */
             flagQ = 0;
-            DebugPrintPlan = true;
-            DebugPrintParse = true;
-            DebugPrintRewrittenParsetree = true;
             DebugLvl = (short)atoi(optarg);
+            if (DebugLvl > 1)
+               DebugPrintQuery = true;
+            if (DebugLvl > 2)
+            {
+               DebugPrintParse = true;
+               DebugPrintPlan = true;
+               DebugPrintRewrittenParsetree = true;
+            }
             break;
             
         case 'E':
@@ -1262,7 +1271,7 @@ PostgresMain(int argc, char *argv[])
      */
     if (IsUnderPostmaster == false) {
         puts("\nPOSTGRES backend interactive interface");
-        puts("$Revision: 1.22 $ $Date: 1996/11/27 13:47:05 $");
+        puts("$Revision: 1.23 $ $Date: 1996/12/07 04:39:06 $");
     }
     
     /* ----------------
index 331333a5cb51a6a115c8366d7b129678c19712a4..6f1a935dd8814ca68da27f9fd759fdb8597cf336 100644 (file)
@@ -1,6 +1,6 @@
 .\" This is -*-nroff-*-
 .\" XXX standard disclaimer belongs here....
-.\" $Header: /cvsroot/pgsql/src/man/Attic/postgres.1,v 1.1 1996/11/14 10:17:46 scrappy Exp $
+.\" $Header: /cvsroot/pgsql/src/man/Attic/postgres.1,v 1.2 1996/12/07 04:39:38 momjian Exp $
 .TH POSTGRES95 UNIX 11/05/95 Postgres95 Postgres95
 .SH NAME
 postgres \(em the Postgres backend server
@@ -84,7 +84,7 @@ Specifies \*(lqquiet\*(rq mode.
 .BR "-d" " debug_level"
 Turns on debugging at the numeric level
 .IR "debug_level" .
-Turning on debugging will cause query parse trees and query plans to
+Turning on debugging will cause query, parse trees, and query plans to
 be displayed.
 .TP
 .BR "-o" " output_file"