Re: Raw parse tree is not dumped to log

From: Tatsuo Ishii <ishii(at)postgresql(dot)org>
To: li(dot)evan(dot)chao(at)gmail(dot)com
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Raw parse tree is not dumped to log
Date: 2025-08-16 05:56:27
Message-ID: 20250816.145627.2040386912312741928.ishii@postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tender Wang 2025-08-16 07:43:47 Fix typos in comments in worker.c and execReplication.c
Previous Message Kirill Reshke 2025-08-16 05:08:28 Re: Retail DDL