PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/htup_details.h"
#include "access/nbtree.h"
#include "access/table.h"
#include "access/tsmapi.h"
#include "catalog/catalog.h"
#include "catalog/pg_am.h"
#include "catalog/pg_amproc.h"
#include "catalog/pg_constraint.h"
#include "catalog/pg_type.h"
#include "commands/defrem.h"
#include "miscadmin.h"
#include "nodes/makefuncs.h"
#include "nodes/nodeFuncs.h"
#include "optimizer/optimizer.h"
#include "parser/analyze.h"
#include "parser/parse_clause.h"
#include "parser/parse_coerce.h"
#include "parser/parse_collate.h"
#include "parser/parse_expr.h"
#include "parser/parse_func.h"
#include "parser/parse_oper.h"
#include "parser/parse_relation.h"
#include "parser/parse_target.h"
#include "parser/parse_type.h"
#include "parser/parser.h"
#include "rewrite/rewriteManip.h"
#include "utils/builtins.h"
#include "utils/catcache.h"
#include "utils/lsyscache.h"
#include "utils/rel.h"
#include "utils/syscache.h"
Go to the source code of this file.
Functions | |
static int | extractRemainingColumns (ParseState *pstate, ParseNamespaceColumn *src_nscolumns, List *src_colnames, List **src_colnos, List **res_colnames, List **res_colvars, ParseNamespaceColumn *res_nscolumns) |
static Node * | transformJoinUsingClause (ParseState *pstate, List *leftVars, List *rightVars) |
static Node * | transformJoinOnClause (ParseState *pstate, JoinExpr *j, List *namespace) |
static ParseNamespaceItem * | transformTableEntry (ParseState *pstate, RangeVar *r) |
static ParseNamespaceItem * | transformRangeSubselect (ParseState *pstate, RangeSubselect *r) |
static ParseNamespaceItem * | transformRangeFunction (ParseState *pstate, RangeFunction *r) |
static ParseNamespaceItem * | transformRangeTableFunc (ParseState *pstate, RangeTableFunc *rtf) |
static TableSampleClause * | transformRangeTableSample (ParseState *pstate, RangeTableSample *rts) |
static ParseNamespaceItem * | getNSItemForSpecialRelationTypes (ParseState *pstate, RangeVar *rv) |
static Node * | transformFromClauseItem (ParseState *pstate, Node *n, ParseNamespaceItem **top_nsitem, List **namespace) |
static Var * | buildVarFromNSColumn (ParseState *pstate, ParseNamespaceColumn *nscol) |
static Node * | buildMergedJoinVar (ParseState *pstate, JoinType jointype, Var *l_colvar, Var *r_colvar) |
static void | markRelsAsNulledBy (ParseState *pstate, Node *n, int jindex) |
static void | setNamespaceColumnVisibility (List *namespace, bool cols_visible) |
static void | setNamespaceLateralState (List *namespace, bool lateral_only, bool lateral_ok) |
static void | checkExprIsVarFree (ParseState *pstate, Node *n, const char *constructName) |
static TargetEntry * | findTargetlistEntrySQL92 (ParseState *pstate, Node *node, List **tlist, ParseExprKind exprKind) |
static TargetEntry * | findTargetlistEntrySQL99 (ParseState *pstate, Node *node, List **tlist, ParseExprKind exprKind) |
static int | get_matching_location (int sortgroupref, List *sortgrouprefs, List *exprs) |
static List * | resolve_unique_index_expr (ParseState *pstate, InferClause *infer, Relation heapRel) |
static List * | addTargetToGroupList (ParseState *pstate, TargetEntry *tle, List *grouplist, List *targetlist, int location) |
static WindowClause * | findWindowClause (List *wclist, const char *name) |
static Node * | transformFrameOffset (ParseState *pstate, int frameOptions, Oid rangeopfamily, Oid rangeopcintype, Oid *inRangeFunc, Node *clause) |
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) |
static void | checkTargetlistEntrySQL92 (ParseState *pstate, TargetEntry *tle, ParseExprKind exprKind) |
static Node * | flatten_grouping_sets (Node *expr, bool toplevel, bool *hasGroupingSets) |
static Index | transformGroupClauseExpr (List **flatresult, Bitmapset *seen_local, ParseState *pstate, Node *gexpr, List **targetlist, List *sortClause, ParseExprKind exprKind, bool useSQL99, bool toplevel) |
static List * | transformGroupClauseList (List **flatresult, ParseState *pstate, List *list, List **targetlist, List *sortClause, ParseExprKind exprKind, bool useSQL99, bool toplevel) |
static Node * | transformGroupingSet (List **flatresult, ParseState *pstate, GroupingSet *gset, List **targetlist, List *sortClause, ParseExprKind exprKind, bool useSQL99, bool toplevel) |
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) |
|
static |
Definition at line 3535 of file parse_clause.c.
References assignSortGroupRef(), cancel_parser_errposition_callback(), COERCE_IMPLICIT_CAST, coerce_type(), COERCION_IMPLICIT, SortGroupClause::eqop, TargetEntry::expr, exprType(), get_sort_group_operators(), InvalidOid, lappend(), makeNode, SortGroupClause::nulls_first, SortGroupClause::reverse_sort, setup_parser_errposition_callback(), SortGroupClause::sortop, targetIsInSortList(), and SortGroupClause::tleSortGroupRef.
Referenced by transformDistinctClause(), transformDistinctOnClause(), and transformGroupClauseExpr().
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().
|
static |
Definition at line 1664 of file parse_clause.c.
References assign_expr_collations(), COERCE_IMPLICIT_CAST, coerce_type(), COERCION_IMPLICIT, elog, ERROR, InvalidOid, IsA, JOIN_FULL, JOIN_INNER, JOIN_LEFT, JOIN_RIGHT, list_make2, makeNode, makeRelabelType(), select_common_type(), and select_common_typmod().
Referenced by transformFromClauseItem().
|
static |
Definition at line 1638 of file parse_clause.c.
References Assert, makeVar(), markNullableIfNeeded(), ParseNamespaceColumn::p_varattno, ParseNamespaceColumn::p_varattnosyn, ParseNamespaceColumn::p_varcollid, ParseNamespaceColumn::p_varno, ParseNamespaceColumn::p_varnosyn, ParseNamespaceColumn::p_vartype, and ParseNamespaceColumn::p_vartypmod.
Referenced by extractRemainingColumns(), and transformFromClauseItem().
|
static |
Definition at line 1923 of file parse_clause.c.
References contain_vars_of_level(), ereport, errcode(), errmsg(), ERROR, locate_var_of_level(), and parser_errposition().
Referenced by transformFrameOffset(), and transformLimitClause().
|
static |
Definition at line 1948 of file parse_clause.c.
References contain_aggs_of_level(), contain_windowfuncs(), elog, ereport, errcode(), errmsg(), ERROR, TargetEntry::expr, EXPR_KIND_DISTINCT_ON, EXPR_KIND_GROUP_BY, EXPR_KIND_ORDER_BY, locate_agg_of_level(), locate_windowfunc(), ParseState::p_hasAggs, ParseState::p_hasWindowFuncs, ParseExprKindName(), and parser_errposition().
Referenced by findTargetlistEntrySQL92().
|
static |
Definition at line 253 of file parse_clause.c.
References attnum, bms_add_member(), bms_is_member(), buildVarFromNSColumn(), lappend(), lappend_int(), lfirst, lfirst_int, and strVal.
Referenced by transformFromClauseItem().
|
static |
Definition at line 2004 of file parse_clause.c.
References castNode, checkTargetlistEntrySQL92(), colNameToVar(), equal(), ereport, errcode(), errmsg(), ERROR, TargetEntry::expr, EXPR_KIND_GROUP_BY, findTargetlistEntrySQL99(), intVal, IsA, lfirst, linitial, list_length(), A_Const::location, name, ParseExprKindName(), parser_errposition(), strVal, and A_Const::val.
Referenced by transformDistinctOnClause(), transformGroupClauseExpr(), and transformSortClause().
|
static |
Definition at line 2170 of file parse_clause.c.
References equal(), TargetEntry::expr, lappend(), lfirst, strip_implicit_coercions(), transformExpr(), and transformTargetEntry().
Referenced by findTargetlistEntrySQL92(), transformGroupClauseExpr(), and transformSortClause().
|
static |
Definition at line 3660 of file parse_clause.c.
Referenced by transformWindowDefinitions().
Definition at line 2256 of file parse_clause.c.
References RowExpr::args, check_stack_depth(), COERCE_IMPLICIT_CAST, GroupingSet::content, GROUPING_SET_EMPTY, GROUPING_SET_SETS, IsA, lappend(), lfirst, list_concat(), GroupingSet::location, makeGroupingSet(), NIL, and Node::type.
Referenced by transformGroupClause().
Definition at line 3174 of file parse_clause.c.
References elog, ERROR, exprLocation(), forboth, lfirst, and lfirst_int.
Referenced by transformDistinctOnClause().
|
static |
Definition at line 1011 of file parse_clause.c.
References addRangeTableEntryForCTE(), addRangeTableEntryForENR(), RangeVar::relname, scanNameSpaceForCTE(), scanNameSpaceForENR(), and RangeVar::schemaname.
Referenced by transformFromClauseItem().
|
static |
Definition at line 1772 of file parse_clause.c.
References bms_add_member(), elog, ERROR, IsA, j, lappend(), lfirst, list_length(), list_nth_cell(), nodeTag, and ParseState::p_nullingrels.
Referenced by transformFromClauseItem().
|
static |
Definition at line 3199 of file parse_clause.c.
References IndexElem::collation, ereport, errcode(), errmsg(), ERROR, IndexElem::expr, InferenceElem::expr, EXPR_KIND_INDEX_EXPRESSION, exprLocation(), ColumnRef::fields, get_opclass_oid(), InferClause::indexElems, InferenceElem::infercollid, InferenceElem::inferopclass, InvalidOid, lappend(), lfirst, list_make1, ColumnRef::location, LookupCollation(), makeNode, makeString(), IndexElem::name, NIL, IndexElem::nulls_ordering, IndexElem::opclass, IndexElem::ordering, parse(), parser_errposition(), SORTBY_DEFAULT, SORTBY_NULLS_DEFAULT, and transformExpr().
Referenced by transformOnConflictArbiter().
|
static |
Definition at line 1813 of file parse_clause.c.
References lfirst, and ParseNamespaceItem::p_cols_visible.
Referenced by transformFromClauseItem().
|
static |
Definition at line 1830 of file parse_clause.c.
References lfirst, ParseNamespaceItem::p_lateral_ok, and ParseNamespaceItem::p_lateral_only.
Referenced by transformFromClause(), transformFromClauseItem(), and transformJoinOnClause().
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().
|
static |
Definition at line 3687 of file parse_clause.c.
References Assert, BTINRANGE_PROC, can_coerce_type(), checkExprIsVarFree(), coerce_to_specific_type(), COERCION_IMPLICIT, ereport, errcode(), errhint(), errmsg(), ERROR, EXPR_KIND_WINDOW_FRAME_GROUPS, EXPR_KIND_WINDOW_FRAME_RANGE, EXPR_KIND_WINDOW_FRAME_ROWS, exprLocation(), exprType(), format_type_be(), FRAMEOPTION_GROUPS, FRAMEOPTION_RANGE, FRAMEOPTION_ROWS, GETSTRUCT, i, InvalidOid, catclist::members, catclist::n_members, ObjectIdGetDatum(), parser_errposition(), ReleaseCatCacheList(), SearchSysCacheList2, transformExpr(), and catctup::tuple.
Referenced by transformWindowDefinitions().
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().
|
static |
Definition at line 1054 of file parse_clause.c.
References addRangeTableEntryForJoin(), Assert, buildMergedJoinVar(), buildVarFromNSColumn(), check_stack_depth(), checkNameSpaceConflicts(), Alias::colnames, elog, ereport, errcode(), errmsg(), ERROR, exprCollation(), exprLocation(), exprType(), exprTypmod(), extractRemainingColumns(), forboth, getNSItemForSpecialRelationTypes(), IsA, j, JOIN_FULL, JOIN_INNER, JOIN_LEFT, JOIN_RIGHT, lappend(), lappend_int(), lfirst, lfirst_int, list_concat(), list_length(), list_make1, list_truncate(), makeNode, makeString(), markRelsAsNulledBy(), NIL, nodeTag, ParseNamespaceItem::p_cols_visible, ParseState::p_joinexprs, ParseNamespaceItem::p_lateral_ok, ParseNamespaceItem::p_lateral_only, ParseNamespaceItem::p_names, ParseState::p_namespace, ParseNamespaceItem::p_nscolumns, ParseNamespaceItem::p_perminfo, ParseNamespaceItem::p_rel_visible, ParseState::p_rtable, ParseNamespaceItem::p_rte, ParseNamespaceItem::p_rtindex, ParseNamespaceColumn::p_varattno, ParseNamespaceColumn::p_varattnosyn, ParseNamespaceColumn::p_varcollid, ParseNamespaceColumn::p_varno, ParseNamespaceColumn::p_varnosyn, ParseNamespaceColumn::p_vartype, ParseNamespaceColumn::p_vartypmod, palloc(), palloc0(), parser_errposition(), RangeTableSample::relation, RTE_RELATION, RangeTblEntry::rtekind, RangeTblRef::rtindex, setNamespaceColumnVisibility(), setNamespaceLateralState(), strVal, RangeTblEntry::tablesample, transformJoinOnClause(), transformJoinUsingClause(), transformJsonTable(), transformRangeFunction(), transformRangeSubselect(), transformRangeTableFunc(), transformRangeTableSample(), and transformTableEntry().
Referenced by transformFromClause().
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().
|
static |
Definition at line 2365 of file parse_clause.c.
References addTargetToGroupList(), bms_is_member(), copyObject, exprLocation(), findTargetlistEntrySQL92(), findTargetlistEntrySQL99(), InvalidOid, lappend(), lfirst, SortGroupClause::nulls_first, TargetEntry::ressortgroupref, targetIsInSortList(), and SortGroupClause::tleSortGroupRef.
Referenced by transformGroupClause(), transformGroupClauseList(), and transformGroupingSet().
|
static |
Definition at line 2473 of file parse_clause.c.
References bms_add_member(), lappend_int(), lfirst, sort-test::list, NIL, and transformGroupClauseExpr().
Referenced by transformGroupingSet().
|
static |
Definition at line 2526 of file parse_clause.c.
References Assert, GroupingSet::content, ereport, errcode(), errmsg(), ERROR, exprLocation(), GROUPING_SET_CUBE, GROUPING_SET_SETS, GROUPING_SET_SIMPLE, IsA, lappend(), lfirst, list_length(), list_make1_int, GroupingSet::location, makeGroupingSet(), NIL, parser_errposition(), transformGroupClauseExpr(), and transformGroupClauseList().
Referenced by transformGroupClause().
|
static |
Definition at line 365 of file parse_clause.c.
References EXPR_KIND_JOIN_ON, j, ParseState::p_namespace, setNamespaceLateralState(), and transformWhereClause().
Referenced by transformFromClauseItem().
|
static |
Definition at line 306 of file parse_clause.c.
References AEXPR_OP, AND_EXPR, coerce_to_boolean(), copyObject, EXPR_KIND_JOIN_USING, forboth, lappend(), lfirst, linitial, list_length(), makeBoolExpr(), makeSimpleA_Expr(), markVarForSelectPriv(), NIL, and transformExpr().
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().
|
static |
Definition at line 463 of file parse_clause.c.
References addRangeTableEntryForFunction(), arg, Assert, assign_list_collations(), COERCE_EXPLICIT_CALL, RangeFunction::coldeflist, contain_vars_of_level(), ereport, errcode(), errhint(), errmsg(), ERROR, EXPR_KIND_FROM_FUNCTION, exprLocation(), fc(), FigureColname(), RangeFunction::functions, RangeFunction::is_rowsfrom, IsA, lappend(), RangeFunction::lateral, lfirst, linitial, list_length(), list_make1, lsecond, makeFuncCall(), NIL, RangeFunction::ordinality, ParseState::p_last_srf, ParseState::p_lateral_active, parser_errposition(), strVal, SystemFuncName(), and transformExpr().
Referenced by transformFromClauseItem().
|
static |
Definition at line 405 of file parse_clause.c.
References addRangeTableEntryForSubquery(), RangeSubselect::alias, Alias::aliasname, Assert, CMD_SELECT, Query::commandType, elog, ERROR, EXPR_KIND_FROM_SUBSELECT, EXPR_KIND_NONE, IsA, isLockedRefname(), RangeSubselect::lateral, ParseState::p_expr_kind, ParseState::p_lateral_active, parse_sub_analyze(), and RangeSubselect::subquery.
Referenced by transformFromClauseItem().
|
static |
Definition at line 686 of file parse_clause.c.
References addRangeTableEntryForTableFunc(), RangeTableFunc::alias, Assert, assign_expr_collations(), bms_add_member(), coerce_to_specific_type(), coerce_to_specific_type_typmod(), RangeTableFuncCol::coldefexpr, RangeTableFuncCol::colexpr, TableFunc::colexprs, RangeTableFuncCol::colname, RangeTableFunc::columns, contain_vars_of_level(), RangeTableFunc::docexpr, TableFunc::docexpr, ereport, errcode(), errmsg(), ERROR, EXPR_KIND_FROM_FUNCTION, RangeTableFuncCol::for_ordinality, TableFunc::functype, get_typcollation(), RangeTableFuncCol::is_not_null, IsA, j, lappend(), lappend_int(), lappend_oid(), RangeTableFunc::lateral, lfirst, lfirst_node, list_length(), ResTarget::location, RangeTableFunc::location, RangeTableFuncCol::location, TableFunc::location, makeNode, makeString(), ResTarget::name, RangeTableFunc::namespaces, NIL, ParseState::p_lateral_active, palloc(), parser_errposition(), pfree(), pstrdup(), RangeTableFunc::rowexpr, TableFunc::rowexpr, TypeName::setof, strVal, TFT_XMLTABLE, transformExpr(), RangeTableFuncCol::typeName, typenameTypeIdAndMod(), and ResTarget::val.
Referenced by transformFromClauseItem().
|
static |
Definition at line 908 of file parse_clause.c.
References arg, RangeTableSample::args, TableSampleClause::args, assign_expr_collations(), coerce_to_specific_type(), ereport, errcode(), errmsg(), errmsg_plural(), ERROR, EXPR_KIND_FROM_FUNCTION, forboth, get_func_rettype(), GetTsmRoutine(), lappend(), lfirst, lfirst_oid, list_length(), RangeTableSample::location, LookupFuncName(), makeNode, RangeTableSample::method, NameListToString(), NIL, OidIsValid, TsmRoutine::parameterTypes, parser_errposition(), RangeTableSample::repeatable, TableSampleClause::repeatable, TsmRoutine::repeatable_across_queries, transformExpr(), and TableSampleClause::tsmhandler.
Referenced by transformFromClauseItem().
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().
|
static |
Definition at line 395 of file parse_clause.c.
References addRangeTableEntry(), RangeVar::alias, and RangeVar::inh.
Referenced by transformFromClauseItem().
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().