Handling RestrictInfo in expression_tree_walker
От | Konstantin Knizhnik |
---|---|
Тема | Handling RestrictInfo in expression_tree_walker |
Дата | |
Msg-id | 20645147-d73b-989f-cee0-8a26b6251d10@postgrespro.ru обсуждение исходный текст |
Ответы |
Re: Handling RestrictInfo in expression_tree_walker
|
Список | pgsql-hackers |
Hi hackers, I wonder if there is some particular reason for not handling T_RestrictInfo node tag in expression_tree_walker? There are many data structure in Postgres which contains lists of RestrictInfo or expression with RestrictInfo as parameter (for example orclause in RestrictInfo). To handle such cases now it is needed to write code performing list iteration and calling expression_tree_walker for each list element and handling RrestrictInfo in callback function: static bool change_varno_walker(Node *node, ChangeVarnoContext *context) { if (node == NULL) return false; if (IsA(node, Var) && ((Var *) node)->varno == context->oldRelid) { ((Var *) node)->varno = context->newRelid; ((Var *) node)->varnoold = context->newRelid; return false; } if (IsA(node, RestrictInfo)) { change_rinfo((RestrictInfo*)node, context->oldRelid, context->newRelid); return false; } return expression_tree_walker(node, change_varno_walker, context); } Are there any complaints against handling RestrictInfo in expression_tree_walker? -- Konstantin Knizhnik Postgres Professional: http://www.postgrespro.com The Russian Postgres Company
В списке pgsql-hackers по дате отправления: