PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/sysattr.h"
#include "access/table.h"
#include "catalog/partition.h"
#include "catalog/pg_inherits.h"
#include "catalog/pg_type.h"
#include "miscadmin.h"
#include "nodes/makefuncs.h"
#include "optimizer/appendinfo.h"
#include "optimizer/inherit.h"
#include "optimizer/optimizer.h"
#include "optimizer/pathnode.h"
#include "optimizer/plancat.h"
#include "optimizer/planmain.h"
#include "optimizer/planner.h"
#include "optimizer/prep.h"
#include "optimizer/restrictinfo.h"
#include "parser/parsetree.h"
#include "parser/parse_relation.h"
#include "partitioning/partdesc.h"
#include "partitioning/partprune.h"
#include "utils/rel.h"
Go to the source code of this file.
bool apply_child_basequals | ( | PlannerInfo * | root, |
RelOptInfo * | parentrel, | ||
RelOptInfo * | childrel, | ||
RangeTblEntry * | childRTE, | ||
AppendRelInfo * | appinfo | ||
) |
Definition at line 836 of file inherit.c.
References adjust_appendrel_attrs(), Assert(), RelOptInfo::baserestrict_min_security, RelOptInfo::baserestrictinfo, RestrictInfo::clause, contain_vars_of_level(), contain_volatile_functions(), DatumGetBool(), eval_const_expressions(), RestrictInfo::has_clone, PlannerInfo::hasPseudoConstantQuals, RestrictInfo::is_clone, RestrictInfo::is_pushed_down, IsA, lappend(), lfirst, make_ands_implicit(), make_restrictinfo(), Min, NIL, RestrictInfo::security_level, and RangeTblEntry::securityQuals.
Referenced by build_simple_rel().
|
static |
Definition at line 795 of file inherit.c.
References PlannerInfo::append_rel_list, Assert(), build_simple_rel(), AppendRelInfo::child_relid, expand_inherited_rtentry(), RangeTblEntry::inh, lfirst, and AppendRelInfo::parent_relid.
Referenced by expand_inherited_rtentry().
void expand_inherited_rtentry | ( | PlannerInfo * | root, |
RelOptInfo * | rel, | ||
RangeTblEntry * | rte, | ||
Index | rti | ||
) |
Definition at line 86 of file inherit.c.
References add_vars_to_targetlist(), PlanRowMark::allMarkTypes, Assert(), bms_make_singleton(), build_simple_rel(), expand_appendrel_subquery(), expand_partitioned_rtentry(), expand_planner_arrays(), expand_single_inheritance_child(), find_all_inheritors(), get_plan_rowmark(), getRTEPermissionInfo(), RangeTblEntry::inh, InvalidOid, PlanRowMark::isParent, lappend(), lfirst_oid, linitial_oid, list_length(), makeTargetEntry(), makeVar(), makeWholeRowVar(), NIL, NoLock, PlannerInfo::parse, planner_rt_fetch, PlannerInfo::processed_tlist, pstrdup(), RelationData::rd_rel, RELATION_IS_OTHER_TEMP, RangeTblEntry::relid, RangeTblEntry::relkind, RangeTblEntry::rellockmode, ROW_MARK_COPY, PlanRowMark::rowmarkId, PlannerInfo::rowMarks, RTE_RELATION, RTE_SUBQUERY, RangeTblEntry::rtekind, PlanRowMark::rti, SelfItemPointerAttributeNumber, snprintf, table_close(), table_open(), TableOidAttributeNumber, and RTEPermissionInfo::updatedCols.
Referenced by add_other_rels_to_query(), and expand_appendrel_subquery().
|
static |
Definition at line 318 of file inherit.c.
References RelOptInfo::all_partrels, Assert(), bms_add_members(), bms_next_member(), bms_num_members(), build_simple_rel(), check_stack_depth(), elog(), ERROR, expand_planner_arrays(), expand_single_inheritance_child(), PlannerInfo::glob, has_partition_attrs(), i, RangeTblEntry::inh, RelOptInfo::live_parts, NoLock, RelOptInfo::nparts, PartitionDescData::nparts, PartitionDescData::oids, palloc0(), PlannerInfo::partColsUpdated, PartitionDirectoryLookup(), prune_append_rel_partitions(), RelationData::rd_rel, RELATION_IS_OTHER_TEMP, RelOptInfo::relids, table_close(), table_open(), translate_col_privs(), and AppendRelInfo::translated_vars.
Referenced by expand_inherited_rtentry().
|
static |
Definition at line 453 of file inherit.c.
References add_row_identity_columns(), add_row_identity_var(), RangeTblEntry::alias, Alias::aliasname, PlannerInfo::all_result_relids, PlanRowMark::allMarkTypes, PlannerInfo::append_rel_list, Assert(), attname, bms_add_member(), bms_is_member(), Alias::colnames, copyObject, RangeTblEntry::eref, RangeTblEntry::inh, InvalidOid, PlanRowMark::isParent, lappend(), PlannerInfo::leaf_result_relids, list_length(), list_nth(), make_append_rel_info(), makeAlias(), makeNode, makeString(), makeVar(), PlanRowMark::markType, NameStr, TupleDescData::natts, NIL, parse(), PlannerInfo::parse, RangeTblEntry::perminfoindex, PlanRowMark::prti, pstrdup(), RelationData::rd_rel, RelationGetDescr, RelationGetRelid, RangeTblEntry::relid, RangeTblEntry::relkind, PlanRowMark::rowmarkId, PlannerInfo::rowMarks, RTE_RELATION, RangeTblEntry::rtekind, PlanRowMark::rti, RangeTblEntry::securityQuals, select_rowmark_type(), PlanRowMark::strength, strVal, TableOidAttributeNumber, RangeTblEntry::tablesample, TupleDescAttr, and PlanRowMark::waitPolicy.
Referenced by expand_inherited_rtentry(), and expand_partitioned_rtentry().
Bitmapset* get_rel_all_updated_cols | ( | PlannerInfo * | root, |
RelOptInfo * | rel | ||
) |
Definition at line 652 of file inherit.c.
References Assert(), bms_union(), CMD_UPDATE, Query::commandType, find_base_rel(), get_dependent_generated_columns(), getRTEPermissionInfo(), IS_OTHER_REL, IS_SIMPLE_REL, PlannerInfo::parse, planner_rt_fetch, RelOptInfo::relid, translate_col_privs_multilevel(), and RTEPermissionInfo::updatedCols.
Referenced by postgresPlanForeignModify().
|
static |
Definition at line 706 of file inherit.c.
References bms_add_member(), bms_is_member(), FirstLowInvalidHeapAttributeNumber, InvalidAttrNumber, lfirst_node, and Var::varattno.
Referenced by expand_partitioned_rtentry(), and translate_col_privs_multilevel().
|
static |
Definition at line 756 of file inherit.c.
References Assert(), elog(), ERROR, RelOptInfo::relid, translate_col_privs(), and AppendRelInfo::translated_vars.
Referenced by get_rel_all_updated_cols().