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 3111 of file parse_expr.c.

3112 {
3113  switch (exprKind)
3114  {
3115  case EXPR_KIND_NONE:
3116  return "invalid expression context";
3117  case EXPR_KIND_OTHER:
3118  return "extension expression";
3119  case EXPR_KIND_JOIN_ON:
3120  return "JOIN/ON";
3121  case EXPR_KIND_JOIN_USING:
3122  return "JOIN/USING";
3124  return "sub-SELECT in FROM";
3126  return "function in FROM";
3127  case EXPR_KIND_WHERE:
3128  return "WHERE";
3129  case EXPR_KIND_POLICY:
3130  return "POLICY";
3131  case EXPR_KIND_HAVING:
3132  return "HAVING";
3133  case EXPR_KIND_FILTER:
3134  return "FILTER";
3136  return "window PARTITION BY";
3138  return "window ORDER BY";
3140  return "window RANGE";
3142  return "window ROWS";
3144  return "window GROUPS";
3146  return "SELECT";
3148  return "INSERT";
3151  return "UPDATE";
3152  case EXPR_KIND_MERGE_WHEN:
3153  return "MERGE WHEN";
3154  case EXPR_KIND_GROUP_BY:
3155  return "GROUP BY";
3156  case EXPR_KIND_ORDER_BY:
3157  return "ORDER BY";
3158  case EXPR_KIND_DISTINCT_ON:
3159  return "DISTINCT ON";
3160  case EXPR_KIND_LIMIT:
3161  return "LIMIT";
3162  case EXPR_KIND_OFFSET:
3163  return "OFFSET";
3164  case EXPR_KIND_RETURNING:
3166  return "RETURNING";
3167  case EXPR_KIND_VALUES:
3169  return "VALUES";
3172  return "CHECK";
3175  return "DEFAULT";
3177  return "index expression";
3179  return "index predicate";
3181  return "statistics expression";
3183  return "USING";
3185  return "EXECUTE";
3187  return "WHEN";
3189  return "partition bound";
3191  return "PARTITION BY";
3193  return "CALL";
3194  case EXPR_KIND_COPY_WHERE:
3195  return "WHERE";
3197  return "GENERATED AS";
3198  case EXPR_KIND_CYCLE_MARK:
3199  return "CYCLE";
3200 
3201  /*
3202  * There is intentionally no default: case here, so that the
3203  * compiler will warn if we add a new ParseExprKind without
3204  * extending this switch. If we do see an unrecognized value at
3205  * runtime, we'll fall through to the "unrecognized" return.
3206  */
3207  }
3208  return "unrecognized expression kind";
3209 }
@ EXPR_KIND_EXECUTE_PARAMETER
Definition: parse_node.h:76
@ EXPR_KIND_DOMAIN_CHECK
Definition: parse_node.h:69
@ EXPR_KIND_COPY_WHERE
Definition: parse_node.h:82
@ EXPR_KIND_COLUMN_DEFAULT
Definition: parse_node.h:70
@ 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:74
@ EXPR_KIND_INDEX_EXPRESSION
Definition: parse_node.h:72
@ EXPR_KIND_MERGE_RETURNING
Definition: parse_node.h:65
@ EXPR_KIND_PARTITION_BOUND
Definition: parse_node.h:79
@ EXPR_KIND_FUNCTION_DEFAULT
Definition: parse_node.h:71
@ EXPR_KIND_WINDOW_FRAME_RANGE
Definition: parse_node.h:51
@ EXPR_KIND_VALUES
Definition: parse_node.h:66
@ EXPR_KIND_FROM_SUBSELECT
Definition: parse_node.h:44
@ EXPR_KIND_POLICY
Definition: parse_node.h:78
@ EXPR_KIND_WINDOW_FRAME_GROUPS
Definition: parse_node.h:53
@ EXPR_KIND_PARTITION_EXPRESSION
Definition: parse_node.h:80
@ EXPR_KIND_JOIN_USING
Definition: parse_node.h:43
@ EXPR_KIND_INDEX_PREDICATE
Definition: parse_node.h:73
@ 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:75
@ 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:83
@ EXPR_KIND_NONE
Definition: parse_node.h:40
@ EXPR_KIND_CALL_ARGUMENT
Definition: parse_node.h:81
@ 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:77
@ 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:68
@ EXPR_KIND_WINDOW_PARTITION
Definition: parse_node.h:49
@ EXPR_KIND_CYCLE_MARK
Definition: parse_node.h:84
@ 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:67

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_RETURNING, 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 118 of file parse_expr.c.

119 {
120  Node *result;
121  ParseExprKind sv_expr_kind;
122 
123  /* Save and restore identity of expression type we're parsing */
124  Assert(exprKind != EXPR_KIND_NONE);
125  sv_expr_kind = pstate->p_expr_kind;
126  pstate->p_expr_kind = exprKind;
127 
128  result = transformExprRecurse(pstate, expr);
129 
130  pstate->p_expr_kind = sv_expr_kind;
131 
132  return result;
133 }
#define Assert(condition)
Definition: c.h:812
static Node * transformExprRecurse(ParseState *pstate, Node *expr)
Definition: parse_expr.c:136
ParseExprKind
Definition: parse_node.h:39
Definition: nodes.h:129
ParseExprKind p_expr_kind
Definition: parse_node.h:230

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

Referenced by analyzeCTE(), array_subscript_transform(), cookConstraint(), cookDefault(), DoCopy(), domainAddCheckConstraint(), 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(), transformJsonTable(), transformJsonTableColumns(), 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 44 of file parse_expr.c.

Referenced by transformAExprOp().