PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
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

const char* ParseExprKindName ( ParseExprKind  exprKind)

Definition at line 3352 of file parse_expr.c.

References EXPR_KIND_ALTER_COL_TRANSFORM, 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_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().

3353 {
3354  switch (exprKind)
3355  {
3356  case EXPR_KIND_NONE:
3357  return "invalid expression context";
3358  case EXPR_KIND_OTHER:
3359  return "extension expression";
3360  case EXPR_KIND_JOIN_ON:
3361  return "JOIN/ON";
3362  case EXPR_KIND_JOIN_USING:
3363  return "JOIN/USING";
3365  return "sub-SELECT in FROM";
3367  return "function in FROM";
3368  case EXPR_KIND_WHERE:
3369  return "WHERE";
3370  case EXPR_KIND_POLICY:
3371  return "POLICY";
3372  case EXPR_KIND_HAVING:
3373  return "HAVING";
3374  case EXPR_KIND_FILTER:
3375  return "FILTER";
3377  return "window PARTITION BY";
3379  return "window ORDER BY";
3381  return "window RANGE";
3383  return "window ROWS";
3385  return "SELECT";
3387  return "INSERT";
3390  return "UPDATE";
3391  case EXPR_KIND_GROUP_BY:
3392  return "GROUP BY";
3393  case EXPR_KIND_ORDER_BY:
3394  return "ORDER BY";
3395  case EXPR_KIND_DISTINCT_ON:
3396  return "DISTINCT ON";
3397  case EXPR_KIND_LIMIT:
3398  return "LIMIT";
3399  case EXPR_KIND_OFFSET:
3400  return "OFFSET";
3401  case EXPR_KIND_RETURNING:
3402  return "RETURNING";
3403  case EXPR_KIND_VALUES:
3405  return "VALUES";
3408  return "CHECK";
3411  return "DEFAULT";
3413  return "index expression";
3415  return "index predicate";
3417  return "USING";
3419  return "EXECUTE";
3421  return "WHEN";
3423  return "PARTITION BY";
3424 
3425  /*
3426  * There is intentionally no default: case here, so that the
3427  * compiler will warn if we add a new ParseExprKind without
3428  * extending this switch. If we do see an unrecognized value at
3429  * runtime, we'll fall through to the "unrecognized" return.
3430  */
3431  }
3432  return "unrecognized expression kind";
3433 }
Node* transformExpr ( ParseState pstate,
Node expr,
ParseExprKind  exprKind 
)

Definition at line 147 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(), transformExpressionList(), transformFrameOffset(), transformFuncCall(), transformGroupingFunc(), transformIndexStmt(), transformJoinUsingClause(), transformLimitClause(), transformOnConflictArbiter(), transformPartitionSpec(), transformRangeFunction(), transformRangeTableSample(), transformTargetEntry(), and transformWhereClause().

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

Variable Documentation

bool Transform_null_equals

Definition at line 45 of file parse_expr.c.

Referenced by transformAExprOp().