【源码日记】type cast
The SQL
select xmin::text::int8;
grammar
a_expr: a_expr TYPECAST Typename { $$ = makeTypeCast($1, $3, @2); }
static Node *
makeTypeCast(Node *arg, TypeName *typename, int location)
{
TypeCast *n = makeNode(TypeCast);
n->arg = arg;
n->typeName = typename;
n->location = location;
return (Node *) n;
}
transformer
transformExprRecurse
case T_TypeCast:
result = transformTypeCast(pstate, (TypeCast *) expr);
break;
result = coerce_to_target_type(pstate, expr, inputType,
targetType, targetTypmod,
COERCION_EXPLICIT,
COERCE_EXPLICIT_CAST,
location);
pstate could be NULL.
posted on 2024-03-08 09:20 winter-loo 阅读(3) 评论(0) 编辑 收藏 举报