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 Transform_null_equals
 

Function Documentation

◆ ParseExprKindName()

const char* ParseExprKindName ( ParseExprKind  exprKind)

Definition at line 3006 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_CYCLE_MARK, 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_STATS_EXPRESSION, 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().

3007 {
3008  switch (exprKind)
3009  {
3010  case EXPR_KIND_NONE:
3011  return "invalid expression context";
3012  case EXPR_KIND_OTHER:
3013  return "extension expression";
3014  case EXPR_KIND_JOIN_ON:
3015  return "JOIN/ON";
3016  case EXPR_KIND_JOIN_USING:
3017  return "JOIN/USING";
3019  return "sub-SELECT in FROM";
3021  return "function in FROM";
3022  case EXPR_KIND_WHERE:
3023  return "WHERE";
3024  case EXPR_KIND_POLICY:
3025  return "POLICY";
3026  case EXPR_KIND_HAVING:
3027  return "HAVING";
3028  case EXPR_KIND_FILTER:
3029  return "FILTER";
3031  return "window PARTITION BY";
3033  return "window ORDER BY";
3035  return "window RANGE";
3037  return "window ROWS";
3039  return "window GROUPS";
3041  return "SELECT";
3043  return "INSERT";
3046  return "UPDATE";
3047  case EXPR_KIND_GROUP_BY:
3048  return "GROUP BY";
3049  case EXPR_KIND_ORDER_BY:
3050  return "ORDER BY";
3051  case EXPR_KIND_DISTINCT_ON:
3052  return "DISTINCT ON";
3053  case EXPR_KIND_LIMIT:
3054  return "LIMIT";
3055  case EXPR_KIND_OFFSET:
3056  return "OFFSET";
3057  case EXPR_KIND_RETURNING:
3058  return "RETURNING";
3059  case EXPR_KIND_VALUES:
3061  return "VALUES";
3064  return "CHECK";
3067  return "DEFAULT";
3069  return "index expression";
3071  return "index predicate";
3073  return "statistics expression";
3075  return "USING";
3077  return "EXECUTE";
3079  return "WHEN";
3081  return "partition bound";
3083  return "PARTITION BY";
3085  return "CALL";
3086  case EXPR_KIND_COPY_WHERE:
3087  return "WHERE";
3089  return "GENERATED AS";
3090  case EXPR_KIND_CYCLE_MARK:
3091  return "CYCLE";
3092 
3093  /*
3094  * There is intentionally no default: case here, so that the
3095  * compiler will warn if we add a new ParseExprKind without
3096  * extending this switch. If we do see an unrecognized value at
3097  * runtime, we'll fall through to the "unrecognized" return.
3098  */
3099  }
3100  return "unrecognized expression kind";
3101 }

◆ transformExpr()

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

Definition at line 94 of file parse_expr.c.

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

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

95 {
96  Node *result;
97  ParseExprKind sv_expr_kind;
98 
99  /* Save and restore identity of expression type we're parsing */
100  Assert(exprKind != EXPR_KIND_NONE);
101  sv_expr_kind = pstate->p_expr_kind;
102  pstate->p_expr_kind = exprKind;
103 
104  result = transformExprRecurse(pstate, expr);
105 
106  pstate->p_expr_kind = sv_expr_kind;
107 
108  return result;
109 }
static Node * transformExprRecurse(ParseState *pstate, Node *expr)
Definition: parse_expr.c:112
Definition: nodes.h:539
ParseExprKind
Definition: parse_node.h:38
ParseExprKind p_expr_kind
Definition: parse_node.h:196
#define Assert(condition)
Definition: c.h:804

Variable Documentation

◆ Transform_null_equals

bool Transform_null_equals

Definition at line 42 of file parse_expr.c.

Referenced by transformAExprOp().