codekingpro/portable-devtools
115k
1/*-------------------------------------------------------------------------2 *3 * restrictinfo.h4 * prototypes for restrictinfo.c.5 *6 *7 * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group8 * Portions Copyright (c) 1994, Regents of the University of California9 *10 * src/include/optimizer/restrictinfo.h11 *12 *-------------------------------------------------------------------------13 */14#ifndef RESTRICTINFO_H15#define RESTRICTINFO_H16 17#include "nodes/pathnodes.h"18 19 20/* Convenience macro for the common case of a valid-everywhere qual */21#define make_simple_restrictinfo(root, clause) \22 make_restrictinfo(root, clause, true, false, false, false, 0, \23 NULL, NULL, NULL)24 25extern RestrictInfo *make_restrictinfo(PlannerInfo *root,26 Expr *clause,27 bool is_pushed_down,28 bool has_clone,29 bool is_clone,30 bool pseudoconstant,31 Index security_level,32 Relids required_relids,33 Relids incompatible_relids,34 Relids outer_relids);35extern RestrictInfo *commute_restrictinfo(RestrictInfo *rinfo, Oid comm_op);36extern bool restriction_is_or_clause(RestrictInfo *restrictinfo);37extern bool restriction_is_securely_promotable(RestrictInfo *restrictinfo,38 RelOptInfo *rel);39extern List *get_actual_clauses(List *restrictinfo_list);40extern List *extract_actual_clauses(List *restrictinfo_list,41 bool pseudoconstant);42extern void extract_actual_join_clauses(List *restrictinfo_list,43 Relids joinrelids,44 List **joinquals,45 List **otherquals);46extern bool has_pseudoconstant_clauses(PlannerInfo *root,47 List *restrictinfo_list);48extern bool join_clause_is_movable_to(RestrictInfo *rinfo, RelOptInfo *baserel);49extern bool join_clause_is_movable_into(RestrictInfo *rinfo,50 Relids currentrelids,51 Relids current_and_outer);52 53#endif /* RESTRICTINFO_H */54 