We don't need this hack any more.
rettype,
-1,
get_typcollation(rettype),
- COERCE_DONTCARE);
+ COERCE_IMPLICIT_CAST);
/* Relabel is dangerous if TLE is a sort/group or setop column */
if (tle->ressortgroupref != 0 || parse->setOperations)
*modifyTargetList = true;
rettype,
-1,
get_typcollation(rettype),
- COERCE_DONTCARE);
+ COERCE_IMPLICIT_CAST);
/* Relabel is dangerous if sort/group or setop column */
if (tle->ressortgroupref != 0 || parse->setOperations)
*modifyTargetList = true;
atttype,
-1,
get_typcollation(atttype),
- COERCE_DONTCARE);
+ COERCE_IMPLICIT_CAST);
/* Relabel is dangerous if sort/group or setop column */
if (tle->ressortgroupref != 0 || parse->setOperations)
*modifyTargetList = true;
*
* This is primarily intended to be used during planning. Therefore, it
* strips any existing RelabelType nodes to maintain the planner's invariant
- * that there are not adjacent RelabelTypes, and it uses COERCE_DONTCARE
- * which would typically be inappropriate earlier.
+ * that there are not adjacent RelabelTypes.
*/
Node *
relabel_to_typmod(Node *expr, int32 typmod)
/* Apply new typmod, preserving the previous exposed type and collation */
return (Node *) makeRelabelType((Expr *) expr, type, typmod, coll,
- COERCE_DONTCARE);
+ COERCE_EXPLICIT_CAST);
}
/*
req_type,
-1,
req_collation,
- COERCE_DONTCARE);
+ COERCE_IMPLICIT_CAST);
else if (exprCollation((Node *) expr) != req_collation)
expr = (Expr *) makeRelabelType(expr,
req_type,
exprTypmod((Node *) expr),
req_collation,
- COERCE_DONTCARE);
+ COERCE_IMPLICIT_CAST);
}
return expr;
exprType(expr),
exprTypmod(expr),
colColl,
- COERCE_DONTCARE);
+ COERCE_IMPLICIT_CAST);
}
tle = makeTargetEntry((Expr *) expr,
relabel->resulttype = exprType(arg);
relabel->resulttypmod = exprTypmod(arg);
relabel->resultcollid = collate->collOid;
- relabel->relabelformat = COERCE_DONTCARE;
+ relabel->relabelformat = COERCE_IMPLICIT_CAST;
relabel->location = collate->location;
/* Don't create stacked RelabelTypes */
fexpr.funcid = funcid;
fexpr.funcresulttype = result_type;
fexpr.funcretset = func_form->proretset;
- fexpr.funcformat = COERCE_DONTCARE;
+ fexpr.funcformat = COERCE_EXPLICIT_CALL;
fexpr.funccollid = result_collid;
fexpr.inputcollid = input_collid;
fexpr.args = args;
newexpr->funcid = funcid;
newexpr->funcresulttype = result_type;
newexpr->funcretset = false;
- newexpr->funcformat = COERCE_DONTCARE; /* doesn't matter */
+ newexpr->funcformat = COERCE_EXPLICIT_CALL; /* doesn't matter */
newexpr->funccollid = result_collid; /* doesn't matter */
newexpr->inputcollid = input_collid;
newexpr->args = args;
fexpr->funcid = funcid;
fexpr->funcresulttype = result_type;
fexpr->funcretset = false;
- fexpr->funcformat = COERCE_DONTCARE; /* doesn't matter */
+ fexpr->funcformat = COERCE_EXPLICIT_CALL; /* doesn't matter */
fexpr->funccollid = result_collid; /* doesn't matter */
fexpr->inputcollid = input_collid;
fexpr->args = args;
args,
InvalidOid,
agg_input_collation,
- COERCE_DONTCARE);
+ COERCE_EXPLICIT_CALL);
/* see if we have a final function */
if (!OidIsValid(finalfn_oid))
args,
InvalidOid,
agg_input_collation,
- COERCE_DONTCARE);
+ COERCE_EXPLICIT_CALL);
}
} CoercionContext;
/*
- * CoercionForm - information showing how to display a function-call node
+ * CoercionForm - how to display a node that could have come from a cast
*
* NB: equal() ignores CoercionForm fields, therefore this *must* not carry
* any semantically significant information. We need that behavior so that
{
COERCE_EXPLICIT_CALL, /* display as a function call */
COERCE_EXPLICIT_CAST, /* display as an explicit cast */
- COERCE_IMPLICIT_CAST, /* implicit cast, so hide it */
- COERCE_DONTCARE /* special case for planner */
+ COERCE_IMPLICIT_CAST /* implicit cast, so hide it */
} CoercionForm;
/*