PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/relation.h"
#include "access/sysattr.h"
#include "access/table.h"
#include "catalog/dependency.h"
#include "commands/trigger.h"
#include "executor/executor.h"
#include "foreign/fdwapi.h"
#include "miscadmin.h"
#include "nodes/makefuncs.h"
#include "nodes/nodeFuncs.h"
#include "optimizer/optimizer.h"
#include "parser/analyze.h"
#include "parser/parse_coerce.h"
#include "parser/parse_relation.h"
#include "parser/parsetree.h"
#include "rewrite/rewriteDefine.h"
#include "rewrite/rewriteHandler.h"
#include "rewrite/rewriteManip.h"
#include "rewrite/rewriteSearchCycle.h"
#include "rewrite/rowsecurity.h"
#include "tcop/tcopprot.h"
#include "utils/builtins.h"
#include "utils/lsyscache.h"
#include "utils/rel.h"
Go to the source code of this file.
Data Structures | |
struct | rewrite_event |
struct | acquireLocksOnSubLinks_context |
Macros | |
#define | ALL_EVENTS ((1 << CMD_INSERT) | (1 << CMD_UPDATE) | (1 << CMD_DELETE)) |
Typedefs | |
typedef struct rewrite_event | rewrite_event |
typedef struct acquireLocksOnSubLinks_context | acquireLocksOnSubLinks_context |
Functions | |
static bool | acquireLocksOnSubLinks (Node *node, acquireLocksOnSubLinks_context *context) |
static Query * | rewriteRuleAction (Query *parsetree, Query *rule_action, Node *rule_qual, int rt_index, CmdType event, bool *returning_flag) |
static List * | adjustJoinTreeList (Query *parsetree, bool removert, int rt_index) |
static List * | rewriteTargetListIU (List *targetList, CmdType commandType, OverridingKind override, Relation target_relation, RangeTblEntry *values_rte, int values_rte_index, Bitmapset **unused_values_attrnos) |
static TargetEntry * | process_matched_tle (TargetEntry *src_tle, TargetEntry *prior_tle, const char *attrName) |
static Node * | get_assignment_input (Node *node) |
static Bitmapset * | findDefaultOnlyColumns (RangeTblEntry *rte) |
static bool | rewriteValuesRTE (Query *parsetree, RangeTblEntry *rte, int rti, Relation target_relation, Bitmapset *unused_cols) |
static void | rewriteValuesRTEToNulls (Query *parsetree, RangeTblEntry *rte) |
static void | markQueryForLocking (Query *qry, Node *jtnode, LockClauseStrength strength, LockWaitPolicy waitPolicy, bool pushedDown) |
static List * | matchLocks (CmdType event, Relation relation, int varno, Query *parsetree, bool *hasUpdate) |
static Query * | fireRIRrules (Query *parsetree, List *activeRIRs) |
static Bitmapset * | adjust_view_column_set (Bitmapset *cols, List *targetlist) |
void | AcquireRewriteLocks (Query *parsetree, bool forExecute, bool forUpdatePushedDown) |
Node * | build_column_default (Relation rel, int attrno) |
static bool | searchForDefault (RangeTblEntry *rte) |
static Query * | ApplyRetrieveRule (Query *parsetree, RewriteRule *rule, int rt_index, Relation relation, List *activeRIRs) |
static bool | fireRIRonSubLink (Node *node, List *activeRIRs) |
static Query * | CopyAndAddInvertedQual (Query *parsetree, Node *rule_qual, int rt_index, CmdType event) |
static List * | fireRules (Query *parsetree, int rt_index, CmdType event, List *locks, bool *instead_flag, bool *returning_flag, Query **qual_product) |
Query * | get_view_query (Relation view) |
bool | view_has_instead_trigger (Relation view, CmdType event, List *mergeActionList) |
static const char * | view_col_is_auto_updatable (RangeTblRef *rtr, TargetEntry *tle) |
const char * | view_query_is_auto_updatable (Query *viewquery, bool check_cols) |
static const char * | view_cols_are_auto_updatable (Query *viewquery, Bitmapset *required_cols, Bitmapset **updatable_cols, char **non_updatable_col) |
int | relation_is_updatable (Oid reloid, List *outer_reloids, bool include_triggers, Bitmapset *include_cols) |
void | error_view_not_updatable (Relation view, CmdType command, List *mergeActionList, const char *detail) |
static Query * | rewriteTargetView (Query *parsetree, Relation view) |
static List * | RewriteQuery (Query *parsetree, List *rewrite_events, int orig_rt_length) |
List * | QueryRewrite (Query *parsetree) |
#define ALL_EVENTS ((1 << CMD_INSERT) | (1 << CMD_UPDATE) | (1 << CMD_DELETE)) |
typedef struct acquireLocksOnSubLinks_context acquireLocksOnSubLinks_context |
typedef struct rewrite_event rewrite_event |
|
static |
Definition at line 302 of file rewriteHandler.c.
References AcquireRewriteLocks(), context, expression_tree_walker, IsA, and SubLink::subselect.
Referenced by AcquireRewriteLocks(), CopyAndAddInvertedQual(), fireRIRrules(), rewriteRuleAction(), and rewriteTargetView().
Definition at line 140 of file rewriteHandler.c.
References AccessShareLock, acquireLocksOnSubLinks(), Assert, context, Query::cteList, CommonTableExpr::ctequery, elog, ERROR, get_parse_rowmark(), get_rte_attribute_is_dropped(), IsA, lappend(), lfirst, NIL, NoLock, QTW_IGNORE_RC_SUBQUERIES, query_tree_walker, RelationData::rd_rel, RangeTblEntry::relid, RowShareLock, rt_fetch, Query::rtable, RTE_JOIN, RTE_RELATION, RTE_SUBQUERY, RangeTblEntry::rtekind, strip_implicit_coercions(), RangeTblEntry::subquery, table_close(), table_open(), Var::varattno, Var::varlevelsup, and Var::varno.
Referenced by acquireLocksOnSubLinks(), ApplyRetrieveRule(), fmgr_sql_validator(), get_query_def(), init_sql_fcache(), inline_set_returning_function(), make_ruledef(), print_function_sqlbody(), refresh_matview_datafill(), and rewriteRuleAction().
Definition at line 3002 of file rewriteHandler.c.
References bms_add_member(), bms_next_member(), castNode, elog, ERROR, TargetEntry::expr, FirstLowInvalidHeapAttributeNumber, get_tle_by_resno(), InvalidAttrNumber, IsA, lfirst_node, and Var::varattno.
Referenced by relation_is_updatable(), and rewriteTargetView().
Definition at line 696 of file rewriteHandler.c.
References copyObject, foreach_delete_current, FromExpr::fromlist, IsA, Query::jointree, lfirst, and RangeTblRef::rtindex.
Referenced by rewriteRuleAction().
|
static |
Definition at line 1717 of file rewriteHandler.c.
References AcquireRewriteLocks(), ChangeVarNodes(), CMD_DELETE, CMD_INSERT, CMD_MERGE, CMD_UPDATE, Query::commandType, copyObject, elog, ereport, errcode(), errmsg(), ERROR, ExecCleanTargetListLength(), fireRIRrules(), FirstNormalObjectId, get_parse_rowmark(), RangeTblEntry::inh, Query::jointree, lappend(), linitial, list_length(), makeString(), makeTargetEntry(), makeWholeRowVar(), markQueryForLocking(), pstrdup(), RelationGetRelationName, RelationGetRelid, RelationIsSecurityView, restrict_nonsystem_relation_kind, RESTRICT_RELKIND_VIEW, Query::returningList, rt_fetch, Query::rtable, RTE_SUBQUERY, RangeTblEntry::rtekind, RowMarkClause::strength, RangeTblEntry::subquery, RangeTblEntry::tablesample, Query::targetList, unlikely, and RowMarkClause::waitPolicy.
Referenced by fireRIRrules().
Definition at line 1224 of file rewriteHandler.c.
References COERCE_IMPLICIT_CAST, coerce_to_target_type(), COERCION_ASSIGNMENT, elog, ereport, errcode(), errhint(), errmsg(), ERROR, exprType(), format_type_be(), get_typdefault(), getIdentitySequence(), makeNode, NameStr, RelationData::rd_att, RelationGetRelationName, NextValueExpr::seqid, TupleDescAttr, TupleDescGetDefault(), and NextValueExpr::typeId.
Referenced by ATExecAddColumn(), ATExecAlterColumnType(), ATExecSetExpression(), BeginCopyFrom(), ExecInitStoredGenerated(), rewriteTargetListIU(), rewriteValuesRTE(), and slot_fill_defaults().
|
static |
Definition at line 2278 of file rewriteHandler.c.
References acquireLocksOnSubLinks(), AddInvertedQual(), ChangeVarNodes(), CMD_INSERT, CMD_UPDATE, context, copyObject, PRS2_NEW_VARNO, PRS2_OLD_VARNO, REPLACEVARS_CHANGE_VARNO, REPLACEVARS_SUBSTITUTE_NULL, ReplaceVarsFromTargetList(), rt_fetch, Query::rtable, and Query::targetList.
Referenced by fireRules().
void error_view_not_updatable | ( | Relation | view, |
CmdType | command, | ||
List * | mergeActionList, | ||
const char * | detail | ||
) |
Definition at line 3076 of file rewriteHandler.c.
References _, generate_unaccent_rules::action, CMD_DELETE, CMD_INSERT, CMD_MERGE, CMD_NOTHING, CMD_UPDATE, elog, ereport, errcode(), errdetail_internal(), errhint(), errmsg(), ERROR, foreach_node, RelationGetRelationName, TriggerDesc::trig_delete_instead_row, TriggerDesc::trig_insert_instead_row, TriggerDesc::trig_update_instead_row, and RelationData::trigdesc.
Referenced by CheckValidResultRel(), RewriteQuery(), and rewriteTargetView().
|
static |
Definition at line 1321 of file rewriteHandler.c.
References bms_add_member(), bms_del_member(), bms_is_empty, i, IsA, lfirst, and RangeTblEntry::values_lists.
Referenced by rewriteTargetListIU().
Definition at line 1955 of file rewriteHandler.c.
References expression_tree_walker, fireRIRrules(), IsA, and SubLink::subselect.
Referenced by fireRIRrules().
Definition at line 1986 of file rewriteHandler.c.
References acquireLocksOnSubLinks(), ApplyRetrieveRule(), CMD_SELECT, context, Query::cteList, CommonTableExpr::ctequery, ereport, errcode(), errmsg(), ERROR, OnConflictExpr::exclRelIndex, expression_tree_walker, fireRIRonSubLink(), get_row_security_policies(), i, lappend(), lappend_oid(), lfirst, lfirst_node, list_concat(), list_delete_last(), list_length(), list_member_oid(), NIL, NoLock, Query::onConflict, QTW_IGNORE_RC_SUBQUERIES, query_tree_walker, rangeTableEntry_used(), RelationData::rd_rules, RelationGetRelationName, RelationGetRelid, RangeTblEntry::relid, rewriteSearchAndCycle(), rt_fetch, Query::rtable, RTE_RELATION, RTE_SUBQUERY, RangeTblEntry::rtekind, rules, RangeTblEntry::subquery, table_close(), and table_open().
Referenced by ApplyRetrieveRule(), fireRIRonSubLink(), and QueryRewrite().
|
static |
Definition at line 2348 of file rewriteHandler.c.
References RewriteRule::actions, CMD_NOTHING, Query::commandType, CopyAndAddInvertedQual(), copyObject, RewriteRule::isInstead, lappend(), lfirst, NIL, QSRC_INSTEAD_RULE, QSRC_NON_INSTEAD_RULE, QSRC_QUAL_INSTEAD_RULE, RewriteRule::qual, and rewriteRuleAction().
Referenced by RewriteQuery().
Definition at line 1195 of file rewriteHandler.c.
References FieldStore::arg, IsA, SubscriptingRef::refassgnexpr, and SubscriptingRef::refexpr.
Referenced by process_matched_tle().
Definition at line 2439 of file rewriteHandler.c.
References Assert, CMD_SELECT, elog, ERROR, i, linitial, list_length(), RuleLock::numLocks, RelationData::rd_rel, RelationData::rd_rules, and RuleLock::rules.
Referenced by ATExecSetRelOptions(), LockViewRecurse(), relation_is_updatable(), and rewriteTargetView().
|
static |
Definition at line 1891 of file rewriteHandler.c.
References ACL_SELECT_FOR_UPDATE, applyLockingClause(), elog, ERROR, FromExpr::fromlist, getRTEPermissionInfo(), IsA, j, Query::jointree, lfirst, nodeTag, RTEPermissionInfo::requiredPerms, rt_fetch, Query::rtable, RTE_RELATION, RTE_SUBQUERY, RangeTblEntry::rtekind, and RangeTblEntry::subquery.
Referenced by ApplyRetrieveRule().
|
static |
Definition at line 1642 of file rewriteHandler.c.
References CMD_MERGE, CMD_SELECT, CMD_UPDATE, Query::commandType, RewriteRule::enabled, ereport, errcode(), errdetail(), errmsg(), ERROR, RewriteRule::event, i, lappend(), NIL, RuleLock::numLocks, rangeTableEntry_used(), RelationData::rd_rules, RelationGetRelationName, RULE_DISABLED, RULE_FIRES_ON_ORIGIN, RULE_FIRES_ON_REPLICA, RuleLock::rules, SESSION_REPLICATION_ROLE_REPLICA, and SessionReplicationRole.
Referenced by RewriteQuery(), and rewriteValuesRTE().
|
static |
Definition at line 1042 of file rewriteHandler.c.
References arg, FieldStore::arg, CoerceToDomain::arg, elog, equal(), ereport, errcode(), errmsg(), ERROR, TargetEntry::expr, exprType(), flatCopyTargetEntry(), get_assignment_input(), IsA, list_concat_copy(), makeNode, FieldStore::newvals, and SubscriptingRef::refexpr.
Referenced by rewriteTargetListIU().
Definition at line 4378 of file rewriteHandler.c.
References Assert, Query::commandType, fireRIRrules(), lappend(), lfirst, NIL, QSRC_INSTEAD_RULE, QSRC_ORIGINAL, QSRC_QUAL_INSTEAD_RULE, and RewriteQuery().
Referenced by ExecCreateTableAs(), ExplainOneUtility(), ExplainQuery(), PerformCursorOpen(), pg_rewrite_query(), and refresh_matview_datafill().
int relation_is_updatable | ( | Oid | reloid, |
List * | outer_reloids, | ||
bool | include_triggers, | ||
Bitmapset * | include_cols | ||
) |
Definition at line 2821 of file rewriteHandler.c.
References AccessShareLock, adjust_view_column_set(), ALL_EVENTS, Assert, bms_int_members(), bms_is_empty, check_stack_depth(), CMD_DELETE, CMD_INSERT, CMD_UPDATE, RewriteRule::event, FdwRoutine::ExecForeignDelete, FdwRoutine::ExecForeignInsert, FdwRoutine::ExecForeignUpdate, FromExpr::fromlist, get_view_query(), GetFdwRoutineForRelation(), i, FdwRoutine::IsForeignRelUpdatable, RewriteRule::isInstead, Query::jointree, lappend_oid(), linitial, list_delete_last(), list_member_oid(), RuleLock::numLocks, RewriteRule::qual, RelationData::rd_rel, RelationData::rd_rules, relation_close(), RelationGetRelid, RangeTblEntry::relid, rt_fetch, Query::rtable, RTE_RELATION, RangeTblEntry::rtekind, RangeTblRef::rtindex, RuleLock::rules, Query::targetList, TriggerDesc::trig_delete_instead_row, TriggerDesc::trig_insert_instead_row, TriggerDesc::trig_update_instead_row, RelationData::trigdesc, try_relation_open(), view_cols_are_auto_updatable(), and view_query_is_auto_updatable().
Referenced by pg_column_is_updatable(), and pg_relation_is_updatable().
Definition at line 3832 of file rewriteHandler.c.
References generate_unaccent_rules::action, OnConflictExpr::action, Assert, castNode, CMD_DELETE, CMD_INSERT, CMD_MERGE, CMD_NOTHING, CMD_SELECT, CMD_UPDATE, CMD_UTILITY, Query::commandType, Query::cteList, CommonTableExpr::ctequery, elog, ereport, errcode(), errhint(), errmsg(), ERROR, error_view_not_updatable(), rewrite_event::event, fireRules(), FromExpr::fromlist, gettext_noop, IsA, Query::jointree, lappend(), lcons(), lfirst, lfirst_node, linitial, linitial_node, list_concat(), list_delete_last(), list_length(), matchLocks(), Query::mergeActionList, NIL, NoLock, Query::onConflict, ONCONFLICT_UPDATE, OnConflictExpr::onConflictSet, OVERRIDING_NOT_SET, palloc(), QSRC_NON_INSTEAD_RULE, QSRC_QUAL_INSTEAD_RULE, RelationData::rd_rel, rewrite_event::relation, RelationGetRelationName, RelationGetRelid, RangeTblEntry::relid, Query::returningList, rewriteTargetListIU(), rewriteTargetView(), rewriteValuesRTE(), rewriteValuesRTEToNulls(), rt_fetch, Query::rtable, RTE_RELATION, RTE_SUBQUERY, RTE_VALUES, RangeTblEntry::rtekind, RangeTblRef::rtindex, RangeTblEntry::subquery, table_close(), table_open(), Query::targetList, and view_has_instead_trigger().
Referenced by QueryRewrite().
|
static |
Definition at line 343 of file rewriteHandler.c.
References acquireLocksOnSubLinks(), AcquireRewriteLocks(), AddQual(), adjustJoinTreeList(), Assert, ChangeVarNodes(), checkExprHasSubLink(), CMD_INSERT, CMD_UPDATE, CMD_UTILITY, CombineRangeTables(), Query::commandType, contain_vars_of_level(), context, copyObject, Query::cteList, CommonTableExpr::ctename, ereport, errcode(), errmsg(), ERROR, FromExpr::fromlist, RangeTblEntry::functions, getInsertSelectQuery(), Query::jointree, lfirst, list_concat(), list_length(), NIL, OffsetVarNodes(), PRS2_NEW_VARNO, PRS2_OLD_VARNO, FromExpr::quals, rangeTableEntry_used(), REPLACEVARS_CHANGE_VARNO, REPLACEVARS_REPORT_ERROR, REPLACEVARS_SUBSTITUTE_NULL, ReplaceVarsFromTargetList(), Query::returningList, rt_fetch, Query::rtable, RTE_FUNCTION, RTE_RELATION, RTE_SUBQUERY, RTE_TABLEFUNC, RTE_VALUES, RangeTblEntry::rtekind, Query::setOperations, RangeTblEntry::subquery, RangeTblEntry::tablefunc, RangeTblEntry::tablesample, Query::targetList, and RangeTblEntry::values_lists.
Referenced by fireRules().
|
static |
Definition at line 758 of file rewriteHandler.c.
References bms_add_member(), bms_is_member(), build_column_default(), CMD_INSERT, CMD_UPDATE, COERCE_IMPLICIT_CAST, coerce_to_domain(), COERCION_IMPLICIT, elog, ereport, errcode(), errdetail(), errhint(), errmsg(), ERROR, TargetEntry::expr, findDefaultOnlyColumns(), flatCopyTargetEntry(), if(), InvalidOid, IsA, lappend(), lfirst, list_concat(), makeConst(), makeTargetEntry(), NameStr, NIL, OVERRIDING_SYSTEM_VALUE, OVERRIDING_USER_VALUE, palloc0(), pfree(), process_matched_tle(), pstrdup(), RelationData::rd_att, RelationGetNumberOfAttributes, TargetEntry::resno, TupleDescAttr, Var::varattno, and Var::varno.
Referenced by RewriteQuery().
Definition at line 3171 of file rewriteHandler.c.
References _, acquireLocksOnSubLinks(), generate_unaccent_rules::action, OnConflictExpr::action, AddQual(), addRangeTableEntryForRelation(), addRTEPermissionInfo(), adjust_view_column_set(), Assert, bms_add_member(), bms_is_empty, bms_union(), BuildOnConflictExcludedTargetlist(), WithCheckOption::cascaded, ChangeVarNodes(), RTEPermissionInfo::checkAsUser, checkExprHasSubLink(), CMD_DELETE, CMD_INSERT, CMD_MERGE, CMD_NOTHING, CMD_UPDATE, Query::commandType, context, copyObject, elog, ereport, errcode(), errdetail(), errdetail_internal(), errhint(), errmsg(), ERROR, error_view_not_updatable(), OnConflictExpr::exclRelIndex, OnConflictExpr::exclRelTlist, TargetEntry::expr, FirstLowInvalidHeapAttributeNumber, FirstNormalObjectId, foreach_node, FromExpr::fromlist, get_tle_by_resno(), get_view_query(), getRTEPermissionInfo(), RangeTblEntry::inh, RTEPermissionInfo::insertedCols, InvalidOid, IsA, Query::jointree, WithCheckOption::kind, lappend(), lcons(), lfirst, linitial, linitial_node, list_length(), make_parsestate(), makeAlias(), makeNode, Query::mergeActionList, NIL, NoLock, Query::onConflict, ONCONFLICT_UPDATE, OnConflictExpr::onConflictSet, ParseNamespaceItem::p_rte, WithCheckOption::polname, pstrdup(), QTW_IGNORE_RC_SUBQUERIES, WithCheckOption::qual, FromExpr::quals, query_tree_walker, RelationData::rd_rel, RelationGetRelationName, RelationGetRelid, RelationHasCascadedCheckOption, RelationHasCheckOption, RelationHasSecurityInvoker, RelationIsSecurityView, RangeTblEntry::relid, WithCheckOption::relname, REPLACEVARS_REPORT_ERROR, ReplaceVarsFromTargetList(), RTEPermissionInfo::requiredPerms, TargetEntry::resno, restrict_nonsystem_relation_kind, RESTRICT_RELKIND_VIEW, RowExclusiveLock, rt_fetch, Query::rtable, RTE_RELATION, RangeTblEntry::rtekind, RangeTblRef::rtindex, RTEPermissionInfo::selectedCols, table_close(), table_open(), Query::targetList, unlikely, RTEPermissionInfo::updatedCols, view_cols_are_auto_updatable(), view_has_instead_trigger(), view_query_is_auto_updatable(), and WCO_VIEW_CHECK.
Referenced by RewriteQuery().
|
static |
Definition at line 1409 of file rewriteHandler.c.
References Assert, bms_is_member(), build_column_default(), CMD_INSERT, COERCE_IMPLICIT_CAST, coerce_to_domain(), COERCION_IMPLICIT, Query::commandType, elog, ERROR, TargetEntry::expr, i, if(), InvalidOid, IsA, RewriteRule::isInstead, lappend(), lfirst, linitial, list_length(), makeConst(), makeNullConst(), matchLocks(), NIL, palloc0(), pfree(), RewriteRule::qual, RelationData::rd_att, RelationData::rd_rel, TargetEntry::resno, RTE_VALUES, RangeTblEntry::rtekind, searchForDefault(), Query::targetList, TupleDescAttr, SetToDefault::typeId, RangeTblEntry::values_lists, Var::varattno, Var::varno, and view_has_instead_trigger().
Referenced by RewriteQuery().
|
static |
Definition at line 1604 of file rewriteHandler.c.
References IsA, lappend(), lfirst, makeNullConst(), NIL, SetToDefault::typeId, and RangeTblEntry::values_lists.
Referenced by RewriteQuery().
|
static |
Definition at line 1295 of file rewriteHandler.c.
References IsA, lfirst, and RangeTblEntry::values_lists.
Referenced by rewriteValuesRTE().
|
static |
Definition at line 2542 of file rewriteHandler.c.
References TargetEntry::expr, gettext_noop, if(), IsA, RangeTblRef::rtindex, Var::varattno, Var::varlevelsup, and Var::varno.
Referenced by view_cols_are_auto_updatable(), and view_query_is_auto_updatable().
|
static |
Definition at line 2738 of file rewriteHandler.c.
References Assert, bms_add_member(), bms_is_member(), FirstLowInvalidHeapAttributeNumber, FromExpr::fromlist, Query::jointree, lfirst, linitial_node, list_length(), Query::targetList, and view_col_is_auto_updatable().
Referenced by relation_is_updatable(), and rewriteTargetView().
Definition at line 2478 of file rewriteHandler.c.
References generate_unaccent_rules::action, CMD_DELETE, CMD_INSERT, CMD_MERGE, CMD_NOTHING, CMD_UPDATE, elog, ERROR, foreach_node, TriggerDesc::trig_delete_instead_row, TriggerDesc::trig_insert_instead_row, TriggerDesc::trig_update_instead_row, and RelationData::trigdesc.
Referenced by CheckValidResultRel(), RewriteQuery(), rewriteTargetView(), and rewriteValuesRTE().
Definition at line 2590 of file rewriteHandler.c.
References Query::cteList, Query::distinctClause, FromExpr::fromlist, gettext_noop, Query::groupClause, Query::groupingSets, Query::havingQual, IsA, Query::jointree, lfirst, Query::limitCount, Query::limitOffset, linitial, list_length(), NIL, rt_fetch, Query::rtable, RTE_RELATION, RangeTblEntry::rtekind, RangeTblRef::rtindex, Query::setOperations, RangeTblEntry::tablesample, Query::targetList, and view_col_is_auto_updatable().
Referenced by ATExecSetRelOptions(), DefineView(), relation_is_updatable(), and rewriteTargetView().