PostgreSQL Source Code  git master
parse_expr.h File Reference
Include dependency graph for parse_expr.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

NodetransformExpr (ParseState *pstate, Node *expr, ParseExprKind exprKind)
 
const char * ParseExprKindName (ParseExprKind exprKind)
 

Variables

bool operator_precedence_warning
 
bool Transform_null_equals
 

Function Documentation

◆ ParseExprKindName()

const char* ParseExprKindName ( ParseExprKind  exprKind)

Definition at line 3481 of file parse_expr.c.

References EXPR_KIND_ALTER_COL_TRANSFORM, EXPR_KIND_CALL_ARGUMENT, EXPR_KIND_CHECK_CONSTRAINT, EXPR_KIND_COLUMN_DEFAULT, EXPR_KIND_COPY_WHERE, EXPR_KIND_DISTINCT_ON, EXPR_KIND_DOMAIN_CHECK, EXPR_KIND_EXECUTE_PARAMETER, EXPR_KIND_FILTER, EXPR_KIND_FROM_FUNCTION, EXPR_KIND_FROM_SUBSELECT, EXPR_KIND_FUNCTION_DEFAULT, EXPR_KIND_GENERATED_COLUMN, EXPR_KIND_GROUP_BY, EXPR_KIND_HAVING, EXPR_KIND_INDEX_EXPRESSION, EXPR_KIND_INDEX_PREDICATE, EXPR_KIND_INSERT_TARGET, EXPR_KIND_JOIN_ON, EXPR_KIND_JOIN_USING, EXPR_KIND_LIMIT, EXPR_KIND_NONE, EXPR_KIND_OFFSET, EXPR_KIND_ORDER_BY, EXPR_KIND_OTHER, EXPR_KIND_PARTITION_BOUND, EXPR_KIND_PARTITION_EXPRESSION, EXPR_KIND_POLICY, EXPR_KIND_RETURNING, EXPR_KIND_SELECT_TARGET, EXPR_KIND_TRIGGER_WHEN, EXPR_KIND_UPDATE_SOURCE, EXPR_KIND_UPDATE_TARGET, EXPR_KIND_VALUES, EXPR_KIND_VALUES_SINGLE, EXPR_KIND_WHERE, EXPR_KIND_WINDOW_FRAME_GROUPS, EXPR_KIND_WINDOW_FRAME_RANGE, EXPR_KIND_WINDOW_FRAME_ROWS, EXPR_KIND_WINDOW_ORDER, and EXPR_KIND_WINDOW_PARTITION.

Referenced by check_agglevels_and_constraints(), check_srf_call_placement(), checkTargetlistEntrySQL92(), findTargetlistEntrySQL92(), and transformWindowFuncCall().

3482 {
3483  switch (exprKind)
3484  {
3485  case EXPR_KIND_NONE:
3486  return "invalid expression context";
3487  case EXPR_KIND_OTHER:
3488  return "extension expression";
3489  case EXPR_KIND_JOIN_ON:
3490  return "JOIN/ON";
3491  case EXPR_KIND_JOIN_USING:
3492  return "JOIN/USING";
3494  return "sub-SELECT in FROM";
3496  return "function in FROM";
3497  case EXPR_KIND_WHERE:
3498  return "WHERE";
3499  case EXPR_KIND_POLICY:
3500  return "POLICY";
3501  case EXPR_KIND_HAVING:
3502  return "HAVING";
3503  case EXPR_KIND_FILTER:
3504  return "FILTER";
3506  return "window PARTITION BY";
3508  return "window ORDER BY";
3510  return "window RANGE";
3512  return "window ROWS";
3514  return "window GROUPS";
3516  return "SELECT";
3518  return "INSERT";
3521  return "UPDATE";
3522  case EXPR_KIND_GROUP_BY:
3523  return "GROUP BY";
3524  case EXPR_KIND_ORDER_BY:
3525  return "ORDER BY";
3526  case EXPR_KIND_DISTINCT_ON:
3527  return "DISTINCT ON";
3528  case EXPR_KIND_LIMIT:
3529  return "LIMIT";
3530  case EXPR_KIND_OFFSET:
3531  return "OFFSET";
3532  case EXPR_KIND_RETURNING:
3533  return "RETURNING";
3534  case EXPR_KIND_VALUES:
3536  return "VALUES";
3539  return "CHECK";
3542  return "DEFAULT";
3544  return "index expression";
3546  return "index predicate";
3548  return "USING";
3550  return "EXECUTE";
3552  return "WHEN";
3554  return "partition bound";
3556  return "PARTITION BY";
3558  return "CALL";
3559  case EXPR_KIND_COPY_WHERE:
3560  return "WHERE";
3562  return "GENERATED AS";
3563 
3564  /*
3565  * There is intentionally no default: case here, so that the
3566  * compiler will warn if we add a new ParseExprKind without
3567  * extending this switch. If we do see an unrecognized value at
3568  * runtime, we'll fall through to the "unrecognized" return.
3569  */
3570  }
3571  return "unrecognized expression kind";
3572 }

◆ transformExpr()

Node* transformExpr ( ParseState pstate,
Node expr,
ParseExprKind  exprKind 
)

Definition at line 144 of file parse_expr.c.

References Assert, EXPR_KIND_NONE, ParseState::p_expr_kind, and transformExprRecurse().

Referenced by cookConstraint(), cookDefault(), DoCopy(), domainAddConstraint(), EvaluateParams(), ExpandIndirectionStar(), findTargetlistEntrySQL99(), interpret_function_parameter_list(), resolve_unique_index_expr(), transformAlterTableStmt(), transformCallStmt(), transformContainerSubscripts(), transformExpressionList(), transformFrameOffset(), transformFuncCall(), transformGroupingFunc(), transformIndexStmt(), transformJoinUsingClause(), transformLimitClause(), transformOnConflictArbiter(), transformPartitionBoundValue(), transformPartitionSpec(), transformRangeFunction(), transformRangeTableFunc(), transformRangeTableSample(), transformTargetEntry(), and transformWhereClause().

145 {
146  Node *result;
147  ParseExprKind sv_expr_kind;
148 
149  /* Save and restore identity of expression type we're parsing */
150  Assert(exprKind != EXPR_KIND_NONE);
151  sv_expr_kind = pstate->p_expr_kind;
152  pstate->p_expr_kind = exprKind;
153 
154  result = transformExprRecurse(pstate, expr);
155 
156  pstate->p_expr_kind = sv_expr_kind;
157 
158  return result;
159 }
static Node * transformExprRecurse(ParseState *pstate, Node *expr)
Definition: parse_expr.c:162
Definition: nodes.h:525
ParseExprKind
Definition: parse_node.h:33
ParseExprKind p_expr_kind
Definition: parse_node.h:191
#define Assert(condition)
Definition: c.h:739

Variable Documentation

◆ operator_precedence_warning

◆ Transform_null_equals

bool Transform_null_equals

Definition at line 43 of file parse_expr.c.

Referenced by transformAExprOp().