1 /*-------------------------------------------------------------------------
2  *
3  * restrictinfo.h
4  *	  prototypes for restrictinfo.c.
5  *
6  *
7  * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/optimizer/restrictinfo.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef RESTRICTINFO_H
15 #define RESTRICTINFO_H
16 
17 #include "nodes/relation.h"
18 
19 
20 /* Convenience macro for the common case of a valid-everywhere qual */
21 #define make_simple_restrictinfo(clause)  \
22 	make_restrictinfo(clause, true, false, false, 0, NULL, NULL, NULL)
23 
24 extern RestrictInfo *make_restrictinfo(Expr *clause,
25 				  bool is_pushed_down,
26 				  bool outerjoin_delayed,
27 				  bool pseudoconstant,
28 				  Index security_level,
29 				  Relids required_relids,
30 				  Relids outer_relids,
31 				  Relids nullable_relids);
32 extern bool restriction_is_or_clause(RestrictInfo *restrictinfo);
33 extern bool restriction_is_securely_promotable(RestrictInfo *restrictinfo,
34 								   RelOptInfo *rel);
35 extern List *get_actual_clauses(List *restrictinfo_list);
36 extern List *extract_actual_clauses(List *restrictinfo_list,
37 					   bool pseudoconstant);
38 extern void extract_actual_join_clauses(List *restrictinfo_list,
39 							Relids joinrelids,
40 							List **joinquals,
41 							List **otherquals);
42 extern bool join_clause_is_movable_to(RestrictInfo *rinfo, RelOptInfo *baserel);
43 extern bool join_clause_is_movable_into(RestrictInfo *rinfo,
44 							Relids currentrelids,
45 							Relids current_and_outer);
46 
47 #endif							/* RESTRICTINFO_H */
48