Обсуждение: Which parts of src/backend/nodes/print.c are used?

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

Which parts of src/backend/nodes/print.c are used?

От
Peter Eisentraut
Дата:
src/backend/nodes/print.c contains a number of functions that print node 
types, mostly to stdout.  Most of these are not actually used anywhere 
in the code.  Are they meant to be inserted into the code ad hoc for 
debugging?  Is anyone using these?

This file has clearly not been updated substantially in a long time, and 
functions like print_expr() are clearly outdated.

elog_node_display() and its callees are used, but I suppose these could 
be kept locally in postgres.c.

Other than that, is this file still needed?



Re: Which parts of src/backend/nodes/print.c are used?

От
Tom Lane
Дата:
Peter Eisentraut <peter@eisentraut.org> writes:
> src/backend/nodes/print.c contains a number of functions that print node 
> types, mostly to stdout.  Most of these are not actually used anywhere 
> in the code.  Are they meant to be inserted into the code ad hoc for 
> debugging?  Is anyone using these?

Personally, I use pprint() a lot.  (I invoke it manually from gdb and
then look into the postmaster log for results.)  Its cousins such as
format_node_dump look like they were added by people with slightly
different tastes in output format, so they probably have a
constituency somewhere.

I tend to agree that print_rt() and the other tree-printing routines
below it (down to, but not including, print_slot) are not as useful
as invoking the outfuncs.c code; but others might think differently.
Sometimes you don't want all the gory detail.

            regards, tom lane