PostgreSQL Source Code
git master
|
#include "parser/parse_node.h"
Go to the source code of this file.
Functions | |
void | transformFromClause (ParseState *pstate, List *frmList) |
int | setTargetTable (ParseState *pstate, RangeVar *relation, bool inh, bool alsoSource, AclMode requiredPerms) |
Node * | transformWhereClause (ParseState *pstate, Node *clause, ParseExprKind exprKind, const char *constructName) |
Node * | transformLimitClause (ParseState *pstate, Node *clause, ParseExprKind exprKind, const char *constructName, LimitOption limitOption) |
List * | transformGroupClause (ParseState *pstate, List *grouplist, List **groupingSets, List **targetlist, List *sortClause, ParseExprKind exprKind, bool useSQL99) |
List * | transformSortClause (ParseState *pstate, List *orderlist, List **targetlist, ParseExprKind exprKind, bool useSQL99) |
List * | transformWindowDefinitions (ParseState *pstate, List *windowdefs, List **targetlist) |
List * | transformDistinctClause (ParseState *pstate, List **targetlist, List *sortClause, bool is_agg) |
List * | transformDistinctOnClause (ParseState *pstate, List *distinctlist, List **targetlist, List *sortClause) |
void | transformOnConflictArbiter (ParseState *pstate, OnConflictClause *onConflictClause, List **arbiterExpr, Node **arbiterWhere, Oid *constraint) |
List * | addTargetToSortList (ParseState *pstate, TargetEntry *tle, List *sortlist, List *targetlist, SortBy *sortby) |
Index | assignSortGroupRef (TargetEntry *tle, List *tlist) |
bool | targetIsInSortList (TargetEntry *tle, Oid sortop, List *sortList) |
ParseNamespaceItem * | transformJsonTable (ParseState *pstate, JsonTable *jt) |
List* addTargetToSortList | ( | ParseState * | pstate, |
TargetEntry * | tle, | ||
List * | sortlist, | ||
List * | targetlist, | ||
SortBy * | sortby | ||
) |
Definition at line 3391 of file parse_clause.c.
References Assert, assignSortGroupRef(), cancel_parser_errposition_callback(), COERCE_IMPLICIT_CAST, coerce_type(), COERCION_IMPLICIT, compatible_oper_opid(), elog, SortGroupClause::eqop, ereport, errcode(), errhint(), errmsg(), ERROR, TargetEntry::expr, exprLocation(), exprType(), get_equality_op_for_ordering_op(), get_sort_group_operators(), InvalidOid, lappend(), llast, SortBy::location, makeNode, NIL, SortBy::node, SortGroupClause::nulls_first, OidIsValid, op_hashjoinable(), SortGroupClause::reverse_sort, setup_parser_errposition_callback(), SORTBY_ASC, SORTBY_DEFAULT, SORTBY_DESC, SortBy::sortby_dir, SortBy::sortby_nulls, SORTBY_NULLS_DEFAULT, SORTBY_NULLS_FIRST, SORTBY_NULLS_LAST, SORTBY_USING, SortGroupClause::sortop, strVal, targetIsInSortList(), SortGroupClause::tleSortGroupRef, and SortBy::useOp.
Referenced by transformAggregateCall(), and transformSortClause().
Index assignSortGroupRef | ( | TargetEntry * | tle, |
List * | tlist | ||
) |
Definition at line 3592 of file parse_clause.c.
References lfirst, and TargetEntry::ressortgroupref.
Referenced by addTargetToGroupList(), addTargetToSortList(), build_minmax_path(), create_unique_plan(), generate_setop_child_grouplist(), and transformDistinctOnClause().
int setTargetTable | ( | ParseState * | pstate, |
RangeVar * | relation, | ||
bool | inh, | ||
bool | alsoSource, | ||
AclMode | requiredPerms | ||
) |
Definition at line 178 of file parse_clause.c.
References addNSItemToQuery(), addRangeTableEntryForRelation(), RangeVar::alias, ereport, errcode(), errmsg(), ERROR, NoLock, ParseNamespaceItem::p_perminfo, ParseNamespaceItem::p_rtindex, ParseState::p_target_nsitem, ParseState::p_target_relation, parserOpenTable(), RangeVar::relname, RTEPermissionInfo::requiredPerms, RowExclusiveLock, scanNameSpaceForENR(), RangeVar::schemaname, and table_close().
Referenced by transformDeleteStmt(), transformInsertStmt(), transformMergeStmt(), and transformUpdateStmt().
bool targetIsInSortList | ( | TargetEntry * | tle, |
Oid | sortop, | ||
List * | sortList | ||
) |
Definition at line 3633 of file parse_clause.c.
References get_commutator(), InvalidOid, lfirst, TargetEntry::ressortgroupref, SortGroupClause::sortop, and SortGroupClause::tleSortGroupRef.
Referenced by addTargetToGroupList(), addTargetToSortList(), check_output_expressions(), examine_simple_variable(), targetIsInAllPartitionLists(), transformDistinctOnClause(), and transformGroupClauseExpr().
List* transformDistinctClause | ( | ParseState * | pstate, |
List ** | targetlist, | ||
List * | sortClause, | ||
bool | is_agg | ||
) |
Definition at line 2983 of file parse_clause.c.
References addTargetToGroupList(), copyObject, ereport, errcode(), errmsg(), ERROR, TargetEntry::expr, exprLocation(), get_sortgroupclause_tle(), lappend(), lfirst, NIL, and parser_errposition().
Referenced by transformAggregateCall(), transformPLAssignStmt(), and transformSelectStmt().
List* transformDistinctOnClause | ( | ParseState * | pstate, |
List * | distinctlist, | ||
List ** | targetlist, | ||
List * | sortClause | ||
) |
Definition at line 3067 of file parse_clause.c.
References addTargetToGroupList(), Assert, assignSortGroupRef(), copyObject, ereport, errcode(), errmsg(), ERROR, EXPR_KIND_DISTINCT_ON, exprLocation(), findTargetlistEntrySQL92(), forboth, get_matching_location(), get_sortgroupref_tle(), InvalidOid, lappend(), lappend_int(), lfirst, lfirst_int, list_member_int(), NIL, parser_errposition(), targetIsInSortList(), and SortGroupClause::tleSortGroupRef.
Referenced by transformPLAssignStmt(), and transformSelectStmt().
void transformFromClause | ( | ParseState * | pstate, |
List * | frmList | ||
) |
Definition at line 112 of file parse_clause.c.
References checkNameSpaceConflicts(), lappend(), lfirst, list_concat(), ParseState::p_joinlist, ParseState::p_namespace, setNamespaceLateralState(), and transformFromClauseItem().
Referenced by transformDeleteStmt(), transformMergeStmt(), transformPLAssignStmt(), transformSelectStmt(), and transformUpdateStmt().
List* transformGroupClause | ( | ParseState * | pstate, |
List * | grouplist, | ||
List ** | groupingSets, | ||
List ** | targetlist, | ||
List * | sortClause, | ||
ParseExprKind | exprKind, | ||
bool | useSQL99 | ||
) |
Definition at line 2630 of file parse_clause.c.
References Assert, bms_add_member(), exprLocation(), flatten_grouping_sets(), GROUPING_SET_CUBE, GROUPING_SET_EMPTY, GROUPING_SET_ROLLUP, GROUPING_SET_SETS, GROUPING_SET_SIMPLE, IsA, lappend(), lfirst, list_make1, list_make1_int, makeGroupingSet(), NIL, transformGroupClauseExpr(), and transformGroupingSet().
Referenced by transformPLAssignStmt(), transformSelectStmt(), and transformWindowDefinitions().
ParseNamespaceItem* transformJsonTable | ( | ParseState * | pstate, |
JsonTable * | jt | ||
) |
Definition at line 74 of file parse_jsontable.c.
References addRangeTableEntryForTableFunc(), JsonTable::alias, Assert, JsonBehavior::btype, castNode, CheckDuplicateColumnOrPathNames(), JsonTable::columns, contain_vars_of_level(), JsonFuncExpr::context_item, JsonTable::context_item, copyObject, TableFunc::docexpr, ereport, errcode(), errdetail(), errmsg(), ERROR, EXPR_KIND_FROM_FUNCTION, TableFunc::functype, generateJsonTablePathName(), IsA, JSON_BEHAVIOR_EMPTY, JSON_BEHAVIOR_EMPTY_ARRAY, JSON_BEHAVIOR_ERROR, JSON_TABLE_OP, JsonTableParseContext::jt, JsonTable::lateral, list_make1, JsonFuncExpr::location, JsonTable::location, TableFunc::location, JsonBehavior::location, makeNode, JsonTablePathSpec::name, JsonFuncExpr::on_empty, JsonFuncExpr::on_error, JsonTable::on_error, JsonFuncExpr::op, ParseState::p_lateral_active, parser_errposition(), JsonFuncExpr::passing, JsonTable::passing, JsonExpr::passing_values, JsonTableParseContext::pathNameId, JsonTableParseContext::pathNames, JsonFuncExpr::pathspec, JsonTable::pathspec, JsonTablePathSpec::string, JsonTableParseContext::tf, TFT_JSON_TABLE, transformExpr(), and transformJsonTableColumns().
Referenced by transformFromClauseItem().
Node* transformLimitClause | ( | ParseState * | pstate, |
Node * | clause, | ||
ParseExprKind | exprKind, | ||
const char * | constructName, | ||
LimitOption | limitOption | ||
) |
Definition at line 1879 of file parse_clause.c.
References castNode, checkExprIsVarFree(), coerce_to_specific_type(), ereport, errcode(), errmsg(), ERROR, EXPR_KIND_LIMIT, IsA, LIMIT_OPTION_WITH_TIES, and transformExpr().
Referenced by transformPLAssignStmt(), transformSelectStmt(), transformSetOperationStmt(), and transformValuesClause().
void transformOnConflictArbiter | ( | ParseState * | pstate, |
OnConflictClause * | onConflictClause, | ||
List ** | arbiterExpr, | ||
Node ** | arbiterWhere, | ||
Oid * | constraint | ||
) |
Definition at line 3295 of file parse_clause.c.
References ACL_SELECT, OnConflictClause::action, bms_add_members(), InferClause::conname, ereport, errcode(), errhint(), errmsg(), ERROR, EXPR_KIND_INDEX_PREDICATE, exprLocation(), get_relation_constraint_attnos(), InferClause::indexElems, OnConflictClause::infer, InvalidOid, IsCatalogRelation(), NIL, ONCONFLICT_UPDATE, ParseNamespaceItem::p_perminfo, ParseState::p_target_nsitem, ParseState::p_target_relation, parser_errposition(), RelationGetRelationName, RelationGetRelid, RelationIsUsedAsCatalogTable, RTEPermissionInfo::requiredPerms, resolve_unique_index_expr(), RTEPermissionInfo::selectedCols, transformExpr(), and InferClause::whereClause.
Referenced by transformOnConflictClause().
List* transformSortClause | ( | ParseState * | pstate, |
List * | orderlist, | ||
List ** | targetlist, | ||
ParseExprKind | exprKind, | ||
bool | useSQL99 | ||
) |
Definition at line 2730 of file parse_clause.c.
References addTargetToSortList(), findTargetlistEntrySQL92(), findTargetlistEntrySQL99(), lfirst, NIL, and SortBy::node.
Referenced by transformAggregateCall(), transformPLAssignStmt(), transformSelectStmt(), transformSetOperationStmt(), transformValuesClause(), and transformWindowDefinitions().
Node* transformWhereClause | ( | ParseState * | pstate, |
Node * | clause, | ||
ParseExprKind | exprKind, | ||
const char * | constructName | ||
) |
Definition at line 1852 of file parse_clause.c.
References coerce_to_boolean(), and transformExpr().
Referenced by AlterPolicy(), CreatePolicy(), CreateTriggerFiringOn(), ParseFuncOrColumn(), test_rls_hooks_permissive(), test_rls_hooks_restrictive(), transformDeleteStmt(), transformIndexStmt(), transformJoinOnClause(), transformJsonAggConstructor(), transformMergeStmt(), transformOnConflictClause(), transformPLAssignStmt(), TransformPubWhereClauses(), transformRuleStmt(), transformSelectStmt(), and transformUpdateStmt().
List* transformWindowDefinitions | ( | ParseState * | pstate, |
List * | windowdefs, | ||
List ** | targetlist | ||
) |
Definition at line 2763 of file parse_clause.c.
References copyObject, elog, WindowDef::endOffset, WindowClause::endOffset, ereport, errcode(), errhint(), errmsg(), ERROR, EXPR_KIND_WINDOW_ORDER, EXPR_KIND_WINDOW_PARTITION, exprCollation(), findWindowClause(), FRAMEOPTION_DEFAULTS, FRAMEOPTION_END_OFFSET, FRAMEOPTION_GROUPS, FRAMEOPTION_RANGE, FRAMEOPTION_START_OFFSET, WindowDef::frameOptions, WindowClause::frameOptions, get_ordering_op_properties(), get_sortgroupclause_expr(), InvalidOid, lappend(), lfirst, linitial_node, list_length(), WindowDef::location, makeNode, WindowDef::name, NIL, SortGroupClause::nulls_first, WindowDef::orderClause, WindowClause::orderClause, parser_errposition(), WindowDef::partitionClause, WindowClause::partitionClause, WindowDef::refname, SortGroupClause::reverse_sort, SortGroupClause::sortop, WindowDef::startOffset, WindowClause::startOffset, transformFrameOffset(), transformGroupClause(), transformSortClause(), and WindowClause::winref.
Referenced by transformPLAssignStmt(), and transformSelectStmt().