I was reviewing some patches today, and during debugging the patches, I wanted to view raw parse tree, so I had to apply my local patch of dumping raw parse for every review, which was so inconvenient.
You may argue that raw parse tree might not be useful for every reviews. I am still ramping up PG development, I'd like to tune SQL statements and see differences of resulting parse trees.
So, I made this patch. The change is quiet simple. I just searched for "Debug_print_parse", and added a new option "Debug_print_raw_parse". Only when the new option is turned on, raw parse tree will be dumped to logs. This way will not make noise to people who are not interested in raw parse tree.
I have run the following tests:
1. In an existing database, edit postgres.conf and add "debug_print_raw_parse = on", then raw parse tree is dumped to logs as expected.
2. Init a new database, "debug_print_raw_parse = off" appears in postgres.conf as expected.
3. "make check" passed
This patches touches config.sgml and rules.sgml, I don't know how to test the doc changes, any suggestion?
One thing I want reviewer's opinion is that, if start "postgres -d 3", it originally only turn on debug_print_parse, now it will turn on debug_print_raw_parse as well, which potentially make people who don't want raw parse tree unhappy. Maybe use "-d 5" or not turning on debug_print_raw_parse at all by "-d"? WDYT?
Chao Li (Evan)
------------------------------