Re: Raw parse tree is not dumped to log - Mailing list pgsql-hackers

From Tatsuo Ishii
Subject Re: Raw parse tree is not dumped to log
Date
Msg-id 20250816.145627.2040386912312741928.ishii@postgresql.org
Whole thread Raw
In response to Re: Raw parse tree is not dumped to log  (Chao Li <li.evan.chao@gmail.com>)
List pgsql-hackers
> Updated the patch to v3 version.

I have looked into this patch.

diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index 20ccb2d6b54..4370e8307f2 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml

Around line 7407 of config.sgml:

        These parameters enable various debugging output to be emitted.
        When set, they print the resulting parse tree, the query rewriter
        output, or the execution plan for each executed query.

I think you should add "the resulting raw parse tree" before "the
resulting parse tree" since the paragraph refers to the each item in
the varlistentry above.

--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -649,6 +649,10 @@ pg_parse_query(const char *query_string)
 
     TRACE_POSTGRESQL_QUERY_PARSE_DONE(query_string);
 
+    if (Debug_print_raw_parse)
+        elog_node_display(LOG, "raw parse tree", raw_parsetree_list,
+                          Debug_pretty_print);
+

I'm tempted to change "if (Debug_print_raw_parse)" to:

    if (unlikely(Debug_print_raw_parse))

But as we have similar if-statements elsewhere
(e.g. Debug_print_parse), maybe we should keep it for a separate
commit.

Best regards,
--
Tatsuo Ishii
SRA OSS K.K.
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp



pgsql-hackers by date:

Previous
From: Kirill Reshke
Date:
Subject: Re: Retail DDL
Next
From: Tender Wang
Date:
Subject: Fix typos in comments in worker.c and execReplication.c