1/*-------------------------------------------------------------------------
2 *
3 * restrictinfo.h
4 * prototypes for restrictinfo.c.
5 *
6 *
7 * Portions Copyright (c) 1996-2019, 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/pathnodes.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
24extern 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);
32extern RestrictInfo *commute_restrictinfo(RestrictInfo *rinfo, Oid comm_op);
33extern bool restriction_is_or_clause(RestrictInfo *restrictinfo);
34extern bool restriction_is_securely_promotable(RestrictInfo *restrictinfo,
35 RelOptInfo *rel);
36extern List *get_actual_clauses(List *restrictinfo_list);
37extern List *extract_actual_clauses(List *restrictinfo_list,
38 bool pseudoconstant);
39extern void extract_actual_join_clauses(List *restrictinfo_list,
40 Relids joinrelids,
41 List **joinquals,
42 List **otherquals);
43extern bool join_clause_is_movable_to(RestrictInfo *rinfo, RelOptInfo *baserel);
44extern bool join_clause_is_movable_into(RestrictInfo *rinfo,
45 Relids currentrelids,
46 Relids current_and_outer);
47
48#endif /* RESTRICTINFO_H */
49