From: Bruce Momjian Date: Sat, 7 Dec 1996 04:39:38 +0000 (+0000) Subject: Reduce printing from debug level 2 ande layout change. X-Git-Tag: REL2_0~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8cedf57eb152440ff06d75066799e6e249d1d336;p=postgresql Reduce printing from debug level 2 ande layout change. --- diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 9faa69e402..be3aeb96f3 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -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; ilen; 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 $"); } /* ---------------- diff --git a/src/man/postgres.1 b/src/man/postgres.1 index 331333a5cb..6f1a935dd8 100644 --- a/src/man/postgres.1 +++ b/src/man/postgres.1 @@ -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"