Re: debugging tools inside postgres - Mailing list pgsql-hackers

From Shigeru Hanada
Subject Re: debugging tools inside postgres
Date
Msg-id 4E044ED3.5060703@gmail.com
Whole thread Raw
In response to debugging tools inside postgres  (HuangQi <huangqiyx@gmail.com>)
Responses Re: debugging tools inside postgres
Re: debugging tools inside postgres
List pgsql-hackers
(2011/06/24 15:35), HuangQi wrote:
> Hi,
>     I'm trying to debug a modification for the query planner. But I found it
> seems the data structure of my planned query is incorrect. I was trying to
> print out the data structure by use the "p" command in gdb which is quite
> inconvenient and takes time. May I know is there any embedded function in
> postgres to print out the node data structures, or any other plan related
> data structures? Thanks.

I think nodeToString() would help.  This function converts node tree
recursively into a string, and it's applicable for any Node-derived
object, such as Expr, Var and Const.

ex)elog(DEBUG1, "%s", nodeToString(plan));

Regards,
-- 
Shigeru Hanada


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: WIP: Fast GiST index build
Next
From: Alexander Korotkov
Date:
Subject: Re: WIP: Fast GiST index build