aboutsummaryrefslogtreecommitdiff
path: root/src/backend/tcop/postgres.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-03-24 04:31:09 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-03-24 04:31:09 +0000
commit10d3995057b2ea89e56adb571c1beb2b972d1c6f (patch)
treec6f7575878aadf8a7a05013bf2e506210ecf890b /src/backend/tcop/postgres.c
parenta25b94c080a644a66983bbcf82a4e358aa47b7df (diff)
downloadpostgresql-10d3995057b2ea89e56adb571c1beb2b972d1c6f.tar.gz
postgresql-10d3995057b2ea89e56adb571c1beb2b972d1c6f.zip
EXPLAIN output now comes out as a query result, not a NOTICE message.
Also, fix debug logging of parse/plan trees so that the messages actually go through elog(), not directly to stdout.
Diffstat (limited to 'src/backend/tcop/postgres.c')
-rw-r--r--src/backend/tcop/postgres.c48
1 files changed, 7 insertions, 41 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index 68358f4966d..bef1b8064c7 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.259 2002/03/22 02:56:35 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.260 2002/03/24 04:31:07 tgl Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
@@ -426,15 +426,8 @@ pg_analyze_and_rewrite(Node *parsetree)
querytree = (Query *) lfirst(list_item);
if (Debug_print_parse)
- {
- if (Debug_pretty_print)
- {
- elog(LOG, "parse tree:");
- nodeDisplay(querytree);
- }
- else
- elog(LOG, "parse tree: %s", nodeToString(querytree));
- }
+ elog_node_display(LOG, "parse tree", querytree,
+ Debug_pretty_print);
if (querytree->commandType == CMD_UTILITY)
{
@@ -470,27 +463,8 @@ pg_analyze_and_rewrite(Node *parsetree)
#endif
if (Debug_print_rewritten)
- {
- if (Debug_pretty_print)
- {
- elog(LOG, "rewritten parse tree:");
- foreach(list_item, querytree_list)
- {
- querytree = (Query *) lfirst(list_item);
- nodeDisplay(querytree);
- printf("\n");
- }
- }
- else
- {
- elog(LOG, "rewritten parse tree:");
- foreach(list_item, querytree_list)
- {
- querytree = (Query *) lfirst(list_item);
- elog(LOG, "%s", nodeToString(querytree));
- }
- }
- }
+ elog_node_display(LOG, "rewritten parse tree", querytree_list,
+ Debug_pretty_print);
return querytree_list;
}
@@ -538,15 +512,7 @@ pg_plan_query(Query *querytree)
* Print plan if debugging.
*/
if (Debug_print_plan)
- {
- if (Debug_pretty_print)
- {
- elog(LOG, "plan:");
- nodeDisplay(plan);
- }
- else
- elog(LOG, "plan: %s", nodeToString(plan));
- }
+ elog_node_display(LOG, "plan", plan, Debug_pretty_print);
return plan;
}
@@ -1722,7 +1688,7 @@ PostgresMain(int argc, char *argv[], const char *username)
if (!IsUnderPostmaster)
{
puts("\nPOSTGRES backend interactive interface ");
- puts("$Revision: 1.259 $ $Date: 2002/03/22 02:56:35 $\n");
+ puts("$Revision: 1.260 $ $Date: 2002/03/24 04:31:07 $\n");
}
/*