Fix xslt_process() to ensure that it inserts a NULL terminator after the
[PostgreSQL.git] / src / include / rewrite / rewriteManip.h
blobe0ab1d9d3284004d1d91d31ac684084ebd1f42e4
1 /*-------------------------------------------------------------------------
3 * rewriteManip.h
4 * Querytree manipulation subroutines for query rewriter.
7 * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
10 * $PostgreSQL$
12 *-------------------------------------------------------------------------
14 #ifndef REWRITEMANIP_H
15 #define REWRITEMANIP_H
17 #include "nodes/parsenodes.h"
20 extern void OffsetVarNodes(Node *node, int offset, int sublevels_up);
21 extern void ChangeVarNodes(Node *node, int old_varno, int new_varno,
22 int sublevels_up);
23 extern void IncrementVarSublevelsUp(Node *node, int delta_sublevels_up,
24 int min_sublevels_up);
25 extern void IncrementVarSublevelsUp_rtable(List *rtable,
26 int delta_sublevels_up, int min_sublevels_up);
28 extern bool rangeTableEntry_used(Node *node, int rt_index,
29 int sublevels_up);
30 extern bool attribute_used(Node *node, int rt_index, int attno,
31 int sublevels_up);
33 extern Query *getInsertSelectQuery(Query *parsetree, Query ***subquery_ptr);
35 extern void AddQual(Query *parsetree, Node *qual);
36 extern void AddInvertedQual(Query *parsetree, Node *qual);
38 extern bool contain_aggs_of_level(Node *node, int levelsup);
39 extern int locate_agg_of_level(Node *node, int levelsup);
40 extern int locate_windowfunc(Node *node);
41 extern bool checkExprHasAggs(Node *node);
42 extern bool checkExprHasWindowFuncs(Node *node);
43 extern bool checkExprHasSubLink(Node *node);
45 extern Node *ResolveNew(Node *node, int target_varno, int sublevels_up,
46 RangeTblEntry *target_rte,
47 List *targetlist, int event, int update_varno);
49 #endif /* REWRITEMANIP_H */