Re: Debugging methods

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Debugging methods
Дата
Msg-id 23959.1220544226@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Debugging methods  (M2Y <mailtoyahoo@gmail.com>)
Список pgsql-hackers
M2Y <mailtoyahoo@gmail.com> writes:
> I am a beginner to Postgres and I am going through code. I would like
> to know the debugging methods used in development.

> Some of my requirements are; for a given query, how parse structures
> are created in pg_parse_query, how they are analyzed and rewritten in
> pg_analyze_and_rewrite and how the final plan is created in
> pg_plan_queries.

What I tend to do when trying to debug those areas is to set breakpoints
at interesting places with gdb, and then use commands like
"call pprint(node_pointer)" to dump the contents of specific parse or
plan trees to the postmaster log.  The reason that outfuncs.c supports
so many node types (many that can't ever appear in stored rules) is
exactly to make it useful for examining internal data structures this
way.

Another possibility is to turn on debug_print_plan and so on, but those
settings only show you the finished results of parsing or planning,
which isn't real helpful for understanding how the code gets from point
A to point B.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: StartupCLOG
Следующее
От: Tom Lane
Дата:
Сообщение: Re: StartupCLOG