PostgreSQL Source Code
git master
|
#include "parser/parse_node.h"
Go to the source code of this file.
Functions | |
List * | transformTargetList (ParseState *pstate, List *targetlist, ParseExprKind exprKind) |
List * | transformExpressionList (ParseState *pstate, List *exprlist, ParseExprKind exprKind, bool allowDefault) |
void | resolveTargetListUnknowns (ParseState *pstate, List *targetlist) |
void | markTargetListOrigins (ParseState *pstate, List *targetlist) |
TargetEntry * | transformTargetEntry (ParseState *pstate, Node *node, Node *expr, ParseExprKind exprKind, char *colname, bool resjunk) |
Expr * | transformAssignedExpr (ParseState *pstate, Expr *expr, ParseExprKind exprKind, const char *colname, int attrno, List *indirection, int location) |
void | updateTargetListEntry (ParseState *pstate, TargetEntry *tle, char *colname, int attrno, List *indirection, int location) |
Node * | transformAssignmentIndirection (ParseState *pstate, Node *basenode, const char *targetName, bool targetIsSubscripting, Oid targetTypeId, int32 targetTypMod, Oid targetCollation, List *indirection, ListCell *indirection_cell, Node *rhs, CoercionContext ccontext, int location) |
List * | checkInsertTargets (ParseState *pstate, List *cols, List **attrnos) |
TupleDesc | expandRecordVariable (ParseState *pstate, Var *var, int levelsup) |
char * | FigureColname (Node *node) |
char * | FigureIndexColname (Node *node) |
List* checkInsertTargets | ( | ParseState * | pstate, |
List * | cols, | ||
List ** | attrnos | ||
) |
Definition at line 1018 of file parse_target.c.
References attnameAttNum(), bms_add_member(), bms_is_member(), ereport, errcode(), errmsg(), ERROR, i, ResTarget::indirection, InvalidAttrNumber, lappend(), lappend_int(), lfirst, ResTarget::location, makeNode, name, ResTarget::name, NameStr, NIL, ParseState::p_target_relation, parser_errposition(), pstrdup(), RelationData::rd_att, RelationGetNumberOfAttributes, RelationGetRelationName, TupleDescAttr, and ResTarget::val.
Referenced by transformInsertStmt(), and transformMergeStmt().
TupleDesc expandRecordVariable | ( | ParseState * | pstate, |
Var * | var, | ||
int | levelsup | ||
) |
Definition at line 1522 of file parse_target.c.
References Assert, attnum, CreateTemplateTupleDesc(), RangeTblEntry::ctelevelsup, CommonTableExpr::ctequery, elog, ERROR, expandRTE(), TargetEntry::expr, exprCollation(), exprType(), exprTypmod(), forboth, get_expr_result_tupdesc(), get_tle_by_resno(), GetCTEForRTE(), GetCTETargetList, GetRTEByRangeTablePosn(), i, if(), InvalidAttrNumber, IsA, label, lfirst, list_length(), list_nth(), Var::location, ParseState::p_rtable, ParseState::parentParseState, Query::rtable, RTE_CTE, RTE_FUNCTION, RTE_GROUP, RTE_JOIN, RTE_NAMEDTUPLESTORE, RTE_RELATION, RTE_RESULT, RTE_SUBQUERY, RTE_TABLEFUNC, RTE_VALUES, RangeTblEntry::rtekind, strVal, RangeTblEntry::subquery, Query::targetList, TupleDescInitEntry(), TupleDescInitEntryCollation(), Var::varattno, Var::varlevelsup, and Var::varno.
Referenced by ExpandRowReference(), and ParseComplexProjection().
char* FigureColname | ( | Node * | node | ) |
Definition at line 1713 of file parse_target.c.
References FigureColnameInternal(), and name.
Referenced by transformRangeFunction(), transformTargetEntry(), and transformXmlExpr().
char* FigureIndexColname | ( | Node * | node | ) |
Definition at line 1732 of file parse_target.c.
References FigureColnameInternal(), and name.
Referenced by transformIndexStmt().
void markTargetListOrigins | ( | ParseState * | pstate, |
List * | targetlist | ||
) |
Definition at line 318 of file parse_target.c.
References TargetEntry::expr, lfirst, and markTargetListOrigin().
Referenced by transformReturningList(), and transformSelectStmt().
void resolveTargetListUnknowns | ( | ParseState * | pstate, |
List * | targetlist | ||
) |
Definition at line 288 of file parse_target.c.
References COERCE_IMPLICIT_CAST, coerce_type(), COERCION_IMPLICIT, TargetEntry::expr, exprType(), and lfirst.
Referenced by transformReturningList(), transformReturnStmt(), and transformSelectStmt().
Expr* transformAssignedExpr | ( | ParseState * | pstate, |
Expr * | expr, | ||
ParseExprKind | exprKind, | ||
const char * | colname, | ||
int | attrno, | ||
List * | indirection, | ||
int | location | ||
) |
Definition at line 455 of file parse_target.c.
References Assert, attnumTypeId(), COERCE_IMPLICIT_CAST, coerce_to_target_type(), COERCION_ASSIGNMENT, ereport, errcode(), errhint(), errmsg(), ERROR, EXPR_KIND_NONE, exprLocation(), exprType(), format_type_be(), IsA, linitial, list_head(), Var::location, makeNullConst(), makeVar(), ParseState::p_expr_kind, ParseState::p_is_insert, ParseNamespaceItem::p_rtindex, ParseState::p_target_nsitem, ParseState::p_target_relation, parser_errposition(), RelationData::rd_att, transformAssignmentIndirection(), TupleDescAttr, and SetToDefault::typeId.
Referenced by transformInsertRow(), and updateTargetListEntry().
Node* transformAssignmentIndirection | ( | ParseState * | pstate, |
Node * | basenode, | ||
const char * | targetName, | ||
bool | targetIsSubscripting, | ||
Oid | targetTypeId, | ||
int32 | targetTypMod, | ||
Oid | targetCollation, | ||
List * | indirection, | ||
ListCell * | indirection_cell, | ||
Node * | rhs, | ||
CoercionContext | ccontext, | ||
int | location | ||
) |
Definition at line 686 of file parse_target.c.
References FieldStore::arg, Assert, attnum, COERCE_IMPLICIT_CAST, coerce_to_domain(), coerce_to_target_type(), COERCION_IMPLICIT, ereport, errcode(), errhint(), errmsg(), ERROR, exprType(), for_each_cell, format_type_be(), get_attnum(), get_atttypetypmodcoll(), getBaseTypeAndTypmod(), i, InvalidAttrNumber, IsA, lappend(), lfirst, list_make1, list_make1_int, lnext(), makeNode, FieldStore::newvals, NIL, parser_errposition(), strVal, transformAssignmentSubscripts(), CaseTestExpr::typeId, and typeidTypeRelid().
Referenced by transformAssignedExpr(), transformAssignmentSubscripts(), and transformPLAssignStmt().
List* transformExpressionList | ( | ParseState * | pstate, |
List * | exprlist, | ||
ParseExprKind | exprKind, | ||
bool | allowDefault | ||
) |
Definition at line 220 of file parse_target.c.
References ExpandColumnRefStar(), ExpandIndirectionStar(), ColumnRef::fields, IsA, lappend(), lfirst, list_concat(), llast, NIL, and transformExpr().
Referenced by transformMergeStmt(), transformRowExpr(), and transformValuesClause().
TargetEntry* transformTargetEntry | ( | ParseState * | pstate, |
Node * | node, | ||
Node * | expr, | ||
ParseExprKind | exprKind, | ||
char * | colname, | ||
bool | resjunk | ||
) |
Definition at line 75 of file parse_target.c.
References EXPR_KIND_UPDATE_SOURCE, FigureColname(), IsA, makeTargetEntry(), ParseState::p_next_resno, and transformExpr().
Referenced by findTargetlistEntrySQL99(), and transformTargetList().
List* transformTargetList | ( | ParseState * | pstate, |
List * | targetlist, | ||
ParseExprKind | exprKind | ||
) |
Definition at line 121 of file parse_target.c.
References Assert, ExpandColumnRefStar(), ExpandIndirectionStar(), EXPR_KIND_UPDATE_SOURCE, ColumnRef::fields, if(), IsA, lappend(), lfirst, list_concat(), llast, NIL, ParseState::p_multiassign_exprs, res, and transformTargetEntry().
Referenced by transformPLAssignStmt(), transformReturningList(), transformSelectStmt(), and transformUpdateTargetList().
void updateTargetListEntry | ( | ParseState * | pstate, |
TargetEntry * | tle, | ||
char * | colname, | ||
int | attrno, | ||
List * | indirection, | ||
int | location | ||
) |
Definition at line 622 of file parse_target.c.
References TargetEntry::expr, EXPR_KIND_UPDATE_TARGET, TargetEntry::resno, and transformAssignedExpr().
Referenced by transformUpdateTargetList().