Is there a way to get SQL as a string from parse tree(Query *) in rewriteHandler? I tried to look into some part of code and found function get_select_query_def() in ruleutils.c but I am not sure how to use that function. I want to add extra condition in where clause, for that first I would deparse parse tree, add condition and parse the modified SQL again.