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

Tweak querytree-dependency-extraction code so that columns of tables

that are explicitly JOINed are not considered dependencies unless they
are actually used in the query: mere presence in the joinaliasvars
list of a JOIN RTE doesn't count as being used.  The patch touches
a number of files because I needed to generalize the API of
query_tree_walker to support an additional flag bit, but the changes
are otherwise quite small.
This commit is contained in:
Tom Lane
2002-09-11 14:48:55 +00:00
parent d634a5903f
commit 6fdc44be71
8 changed files with 89 additions and 55 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.53 2002/06/20 20:29:51 momjian Exp $
* $Id: clauses.h,v 1.54 2002/09/11 14:48:55 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -66,10 +66,15 @@ extern bool expression_tree_walker(Node *node, bool (*walker) (),
void *context);
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 */
extern bool query_tree_walker(Query *query, bool (*walker) (),
void *context, bool visitQueryRTEs);
void *context, int flags);
extern void query_tree_mutator(Query *query, Node *(*mutator) (),
void *context, bool visitQueryRTEs);
void *context, int flags);
#define is_subplan(clause) ((clause) != NULL && \
IsA(clause, Expr) && \