]> granicus.if.org Git - postgresql/blob - src/include/optimizer/clauses.h
New pgindent.
[postgresql] / src / include / optimizer / clauses.h
1 /*-------------------------------------------------------------------------
2  *
3  * clauses.h--
4  *        prototypes for clauses.c.
5  *
6  *
7  * Copyright (c) 1994, Regents of the University of California
8  *
9  * $Id: clauses.h,v 1.11 1998/08/09 04:59:08 momjian Exp $
10  *
11  *-------------------------------------------------------------------------
12  */
13 #ifndef CLAUSES_H
14 #define CLAUSES_H
15
16 #include <nodes/primnodes.h>
17
18 extern Expr *make_clause(int type, Node *oper, List *args);
19 extern bool is_opclause(Node *clause);
20 extern Expr *make_opclause(Oper *op, Var *leftop, Var *rightop);
21 extern Var *get_leftop(Expr *clause);
22 extern Var *get_rightop(Expr *clause);
23
24 extern bool is_funcclause(Node *clause);
25 extern Expr *make_funcclause(Func *func, List *funcargs);
26
27 extern bool or_clause(Node *clause);
28 extern Expr *make_orclause(List *orclauses);
29
30 extern bool not_clause(Node *clause);
31 extern Expr *make_notclause(Expr *notclause);
32 extern Expr *get_notclausearg(Expr *notclause);
33
34 extern bool and_clause(Node *clause);
35 extern Expr *make_andclause(List *andclauses);
36
37 extern List *pull_constant_clauses(List *quals, List **constantQual);
38 extern void clause_get_relids_vars(Node *clause, List **relids, List **vars);
39 extern int      NumRelids(Node *clause);
40 extern bool contains_not(Node *clause);
41 extern bool join_clause_p(Node *clause);
42 extern bool qual_clause_p(Node *clause);
43 extern void fix_opid(Node *clause);
44 extern List *fix_opids(List *clauses);
45 extern void
46 get_relattval(Node *clause, int *relid,
47                           AttrNumber *attno, Datum *constval, int *flag);
48 extern void
49 get_rels_atts(Node *clause, int *relid1,
50                           AttrNumber *attno1, int *relid2, AttrNumber *attno2);
51 extern void CommuteClause(Node *clause);
52
53 #define is_subplan(clause)      ((Node*) clause != NULL && \
54                                                 nodeTag((Node*) clause) == T_Expr && \
55                                                 ((Expr *) clause)->opType == SUBPLAN_EXPR)
56
57 #endif                                                  /* CLAUSES_H */