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

PGDLLIMPORT bool Transform_null_equals
 

Function Documentation

◆ ParseExprKindName()

const char* ParseExprKindName ( ParseExprKind  exprKind)

Definition at line 2951 of file parse_expr.c.

2952 {
2953  switch (exprKind)
2954  {
2955  case EXPR_KIND_NONE:
2956  return "invalid expression context";
2957  case EXPR_KIND_OTHER:
2958  return "extension expression";
2959  case EXPR_KIND_JOIN_ON:
2960  return "JOIN/ON";
2961  case EXPR_KIND_JOIN_USING:
2962  return "JOIN/USING";
2964  return "sub-SELECT in FROM";
2966  return "function in FROM";
2967  case EXPR_KIND_WHERE:
2968  return "WHERE";
2969  case EXPR_KIND_POLICY:
2970  return "POLICY";
2971  case EXPR_KIND_HAVING:
2972  return "HAVING";
2973  case EXPR_KIND_FILTER:
2974  return "FILTER";
2976  return "window PARTITION BY";
2978  return "window ORDER BY";
2980  return "window RANGE";
2982  return "window ROWS";
2984  return "window GROUPS";
2986  return "SELECT";
2988  return "INSERT";
2991  return "UPDATE";
2992  case EXPR_KIND_MERGE_WHEN:
2993  return "MERGE WHEN";
2994  case EXPR_KIND_GROUP_BY:
2995  return "GROUP BY";
2996  case EXPR_KIND_ORDER_BY:
2997  return "ORDER BY";
2998  case EXPR_KIND_DISTINCT_ON:
2999  return "DISTINCT ON";
3000  case EXPR_KIND_LIMIT:
3001  return "LIMIT";
3002  case EXPR_KIND_OFFSET:
3003  return "OFFSET";
3004  case EXPR_KIND_RETURNING:
3005  return "RETURNING";
3006  case EXPR_KIND_VALUES:
3008  return "VALUES";
3011  return "CHECK";
3014  return "DEFAULT";
3016  return "index expression";
3018  return "index predicate";
3020  return "statistics expression";
3022  return "USING";
3024  return "EXECUTE";
3026  return "WHEN";
3028  return "partition bound";
3030  return "PARTITION BY";
3032  return "CALL";
3033  case EXPR_KIND_COPY_WHERE:
3034  return "WHERE";
3036  return "GENERATED AS";
3037  case EXPR_KIND_CYCLE_MARK:
3038  return "CYCLE";
3039 
3040  /*
3041  * There is intentionally no default: case here, so that the
3042  * compiler will warn if we add a new ParseExprKind without
3043  * extending this switch. If we do see an unrecognized value at
3044  * runtime, we'll fall through to the "unrecognized" return.
3045  */
3046  }
3047  return "unrecognized expression kind";
3048 }
@ EXPR_KIND_EXECUTE_PARAMETER
Definition: parse_node.h:75
@ EXPR_KIND_DOMAIN_CHECK
Definition: parse_node.h:68
@ EXPR_KIND_COPY_WHERE
Definition: parse_node.h:81
@ EXPR_KIND_COLUMN_DEFAULT
Definition: parse_node.h:69
@ EXPR_KIND_DISTINCT_ON
Definition: parse_node.h:61
@ EXPR_KIND_MERGE_WHEN
Definition: parse_node.h:58
@ EXPR_KIND_STATS_EXPRESSION
Definition: parse_node.h:73
@ EXPR_KIND_INDEX_EXPRESSION
Definition: parse_node.h:71
@ EXPR_KIND_PARTITION_BOUND
Definition: parse_node.h:78
@ EXPR_KIND_FUNCTION_DEFAULT
Definition: parse_node.h:70
@ EXPR_KIND_WINDOW_FRAME_RANGE
Definition: parse_node.h:51
@ EXPR_KIND_VALUES
Definition: parse_node.h:65
@ EXPR_KIND_FROM_SUBSELECT
Definition: parse_node.h:44
@ EXPR_KIND_POLICY
Definition: parse_node.h:77
@ EXPR_KIND_WINDOW_FRAME_GROUPS
Definition: parse_node.h:53
@ EXPR_KIND_PARTITION_EXPRESSION
Definition: parse_node.h:79
@ EXPR_KIND_JOIN_USING
Definition: parse_node.h:43
@ EXPR_KIND_INDEX_PREDICATE
Definition: parse_node.h:72
@ EXPR_KIND_ORDER_BY
Definition: parse_node.h:60
@ EXPR_KIND_OFFSET
Definition: parse_node.h:63
@ EXPR_KIND_JOIN_ON
Definition: parse_node.h:42
@ EXPR_KIND_HAVING
Definition: parse_node.h:47
@ EXPR_KIND_INSERT_TARGET
Definition: parse_node.h:55
@ EXPR_KIND_ALTER_COL_TRANSFORM
Definition: parse_node.h:74
@ EXPR_KIND_LIMIT
Definition: parse_node.h:62
@ EXPR_KIND_WHERE
Definition: parse_node.h:46
@ EXPR_KIND_UPDATE_TARGET
Definition: parse_node.h:57
@ EXPR_KIND_SELECT_TARGET
Definition: parse_node.h:54
@ EXPR_KIND_RETURNING
Definition: parse_node.h:64
@ EXPR_KIND_GENERATED_COLUMN
Definition: parse_node.h:82
@ EXPR_KIND_NONE
Definition: parse_node.h:40
@ EXPR_KIND_CALL_ARGUMENT
Definition: parse_node.h:80
@ EXPR_KIND_GROUP_BY
Definition: parse_node.h:59
@ EXPR_KIND_OTHER
Definition: parse_node.h:41
@ EXPR_KIND_FROM_FUNCTION
Definition: parse_node.h:45
@ EXPR_KIND_TRIGGER_WHEN
Definition: parse_node.h:76
@ EXPR_KIND_FILTER
Definition: parse_node.h:48
@ EXPR_KIND_UPDATE_SOURCE
Definition: parse_node.h:56
@ EXPR_KIND_CHECK_CONSTRAINT
Definition: parse_node.h:67
@ EXPR_KIND_WINDOW_PARTITION
Definition: parse_node.h:49
@ EXPR_KIND_CYCLE_MARK
Definition: parse_node.h:83
@ EXPR_KIND_WINDOW_FRAME_ROWS
Definition: parse_node.h:52
@ EXPR_KIND_WINDOW_ORDER
Definition: parse_node.h:50
@ EXPR_KIND_VALUES_SINGLE
Definition: parse_node.h:66

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_MERGE_WHEN, 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().

◆ transformExpr()

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

Definition at line 92 of file parse_expr.c.

93 {
94  Node *result;
95  ParseExprKind sv_expr_kind;
96 
97  /* Save and restore identity of expression type we're parsing */
98  Assert(exprKind != EXPR_KIND_NONE);
99  sv_expr_kind = pstate->p_expr_kind;
100  pstate->p_expr_kind = exprKind;
101 
102  result = transformExprRecurse(pstate, expr);
103 
104  pstate->p_expr_kind = sv_expr_kind;
105 
106  return result;
107 }
Assert(fmt[strlen(fmt) - 1] !='\n')
static Node * transformExprRecurse(ParseState *pstate, Node *expr)
Definition: parse_expr.c:110
ParseExprKind
Definition: parse_node.h:39
Definition: nodes.h:129
ParseExprKind p_expr_kind
Definition: parse_node.h:210

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(), transformMergeStmt(), transformOnConflictArbiter(), transformPartitionBoundValue(), transformPartitionSpec(), transformPLAssignStmt(), transformRangeFunction(), transformRangeTableFunc(), transformRangeTableSample(), transformReturnStmt(), transformStatsStmt(), transformTargetEntry(), and transformWhereClause().

Variable Documentation

◆ Transform_null_equals

PGDLLIMPORT bool Transform_null_equals
extern

Definition at line 42 of file parse_expr.c.

Referenced by transformAExprOp().