pgsql: Allow to log raw parse tree.

Поиск
Список
Период
Сортировка
Искать

pgsql: Allow to log raw parse tree.

От:
Tatsuo Ishii <ishii@postgresql.org>
Дата:
Allow to log raw parse tree.

This commit allows to log the raw parse tree in the same way we
currently log the parse tree, rewritten tree, and plan tree.

To avoid unnecessary log noise for users not interested in this
detail, a new GUC option, "debug_print_raw_parse", has been added.

When starting the PostgreSQL process with "-d N", and N is 3 or higher,
debug_print_raw_parse is enabled automatically, alongside
debug_print_parse.

Author: Chao Li 
Reviewed-by: Tender Wang 
Reviewed-by: Tatsuo Ishii 
Reviewed-by: John Naylor 
Discussion: https://postgr.es/m/CAEoWx2mcO0Gpo4vd8kPMAFWeJLSp0MeUUnaLdE1x0tSVd-VzUw%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/06473f5a344df8c9594ead90a609b86f6724cff8

Modified Files
--------------
doc/src/sgml/config.sgml                      | 12 +++++++++---
doc/src/sgml/rules.sgml                       |  1 +
src/backend/tcop/postgres.c                   |  7 +++++++
src/backend/utils/misc/guc_parameters.dat     |  6 ++++++
src/backend/utils/misc/guc_tables.c           |  1 +
src/backend/utils/misc/postgresql.conf.sample |  1 +
src/include/utils/guc.h                       |  1 +
7 files changed, 26 insertions(+), 3 deletions(-)

Re: pgsql: Allow to log raw parse tree.

От:
Michael Paquier <michael@paquier.xyz>
Дата:
Вложения:
On Fri, Sep 05, 2025 at 10:52:55PM +0000, Tatsuo Ishii wrote:
> Allow to log raw parse tree.
> 
> This commit allows to log the raw parse tree in the same way we
> currently log the parse tree, rewritten tree, and plan tree.
> 
> To avoid unnecessary log noise for users not interested in this
> detail, a new GUC option, "debug_print_raw_parse", has been added.
> 
> When starting the PostgreSQL process with "-d N", and N is 3 or higher,
> debug_print_raw_parse is enabled automatically, alongside
> debug_print_parse.

prion is complaining here:
https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=prion&dt=2025-09-05%2023%3A03%3A05

I did not look into the details, but this usually points to a
use-after-free problem.
--
Michael

Re: pgsql: Allow to log raw parse tree.

От:
Tatsuo Ishii <ishii@postgresql.org>
Дата:
> prion is complaining here:
> https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=prion&dt=2025-09-05%2023%3A03%3A05
> 
> I did not look into the details, but this usually points to a
> use-after-free problem.

Regression diff shows:

diff -U3 /home/ec2-user/bf/root/HEAD/pgsql/src/test/regress/expected/create_table.out /home/ec2-user/bf/root/HEAD/pgsql.build/src/test/regress/results/create_table.out
--- /home/ec2-user/bf/root/HEAD/pgsql/src/test/regress/expected/create_table.out	2025-09-05 23:03:07.629079514 +0000
+++ /home/ec2-user/bf/root/HEAD/pgsql.build/src/test/regress/results/create_table.out	2025-09-05 23:06:31.360832166 +0000
@@ -83,13 +83,16 @@
 -- create an extra wide table to test for issues related to that
 -- (temporarily hide query, to avoid the long CREATE TABLE stmt)
 \\set ECHO none
+ERROR:  could not extend file "base/16384/1249" with FileFallocate(): No space left on device
+HINT:  Check free disk space.

Looks like out of disk space?

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


FAQ