1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-27 00:12:01 +03:00

Adjust API of expression_tree_mutator and query_tree_mutator to

simplify callers.  It turns out the common case is that the caller
does want to recurse into sub-queries, so push support for that into
these subroutines.
This commit is contained in:
Tom Lane
2003-01-17 02:01:21 +00:00
parent 227a404cf4
commit a4d82dd4b4
8 changed files with 167 additions and 220 deletions

View File

@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: clauses.h,v 1.59 2003/01/15 19:35:47 tgl Exp $
* $Id: clauses.h,v 1.60 2003/01/17 02:01:21 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -75,12 +75,18 @@ extern Node *expression_tree_mutator(Node *node, Node *(*mutator) (),
void *context);
/* flags bits for query_tree_walker and query_tree_mutator */
#define QTW_IGNORE_SUBQUERIES 0x01 /* subqueries in rtable */
#define QTW_IGNORE_JOINALIASES 0x02 /* JOIN alias var lists */
#define QTW_IGNORE_RT_SUBQUERIES 0x01 /* subqueries in rtable */
#define QTW_IGNORE_JOINALIASES 0x02 /* JOIN alias var lists */
#define QTW_DONT_COPY_QUERY 0x04 /* do not copy top Query */
extern bool query_tree_walker(Query *query, bool (*walker) (),
void *context, int flags);
extern void query_tree_mutator(Query *query, Node *(*mutator) (),
void *context, int flags);
extern Query *query_tree_mutator(Query *query, Node *(*mutator) (),
void *context, int flags);
extern bool query_or_expression_tree_walker(Node *node, bool (*walker) (),
void *context, int flags);
extern Node *query_or_expression_tree_mutator(Node *node, Node *(*mutator) (),
void *context, int flags);
#endif /* CLAUSES_H */