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 3402 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_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_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_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().

3403 {
3404  switch (exprKind)
3405  {
3406  case EXPR_KIND_NONE:
3407  return "invalid expression context";
3408  case EXPR_KIND_OTHER:
3409  return "extension expression";
3410  case EXPR_KIND_JOIN_ON:
3411  return "JOIN/ON";
3412  case EXPR_KIND_JOIN_USING:
3413  return "JOIN/USING";
3415  return "sub-SELECT in FROM";
3417  return "function in FROM";
3418  case EXPR_KIND_WHERE:
3419  return "WHERE";
3420  case EXPR_KIND_POLICY:
3421  return "POLICY";
3422  case EXPR_KIND_HAVING:
3423  return "HAVING";
3424  case EXPR_KIND_FILTER:
3425  return "FILTER";
3427  return "window PARTITION BY";
3429  return "window ORDER BY";
3431  return "window RANGE";
3433  return "window ROWS";
3435  return "window GROUPS";
3437  return "SELECT";
3439  return "INSERT";
3442  return "UPDATE";
3443  case EXPR_KIND_GROUP_BY:
3444  return "GROUP BY";
3445  case EXPR_KIND_ORDER_BY:
3446  return "ORDER BY";
3447  case EXPR_KIND_DISTINCT_ON:
3448  return "DISTINCT ON";
3449  case EXPR_KIND_LIMIT:
3450  return "LIMIT";
3451  case EXPR_KIND_OFFSET:
3452  return "OFFSET";
3453  case EXPR_KIND_RETURNING:
3454  return "RETURNING";
3455  case EXPR_KIND_VALUES:
3457  return "VALUES";
3460  return "CHECK";
3463  return "DEFAULT";
3465  return "index expression";
3467  return "index predicate";
3469  return "USING";
3471  return "EXECUTE";
3473  return "WHEN";
3475  return "PARTITION BY";
3477  return "CALL";
3478 
3479  /*
3480  * There is intentionally no default: case here, so that the
3481  * compiler will warn if we add a new ParseExprKind without
3482  * extending this switch. If we do see an unrecognized value at
3483  * runtime, we'll fall through to the "unrecognized" return.
3484  */
3485  }
3486  return "unrecognized expression kind";
3487 }

◆ transformExpr()

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

Definition at line 146 of file parse_expr.c.

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

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

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

Variable Documentation

◆ operator_precedence_warning

◆ Transform_null_equals

bool Transform_null_equals

Definition at line 45 of file parse_expr.c.

Referenced by transformAExprOp().