*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/parser/parse_coerce.c,v 2.112 2003/11/29 19:51:52 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/parser/parse_coerce.c,v 2.113 2003/12/17 19:49:39 tgl Exp $
*
*-------------------------------------------------------------------------
*/
/* no conversion needed */
return node;
}
+ if (targetTypeId == ANYOID ||
+ targetTypeId == ANYARRAYOID ||
+ targetTypeId == ANYELEMENTOID)
+ {
+ /* assume can_coerce_type verified that implicit coercion is okay */
+ /* NB: we do NOT want a RelabelType here */
+ return node;
+ }
if (inputTypeId == UNKNOWNOID && IsA(node, Const))
{
/*
param->paramtype = targetTypeId;
return (Node *) param;
}
- if (targetTypeId == ANYOID ||
- targetTypeId == ANYARRAYOID ||
- targetTypeId == ANYELEMENTOID)
- {
- /* assume can_coerce_type verified that implicit coercion is okay */
- /* NB: we do NOT want a RelabelType here */
- return node;
- }
if (find_coercion_pathway(targetTypeId, inputTypeId, ccontext,
&funcId))
{
if (!typeidIsValid(targetTypeId))
return false;
- /*
- * If input is an untyped string constant, assume we can convert
- * it to anything except a class type.
- */
- if (inputTypeId == UNKNOWNOID)
- {
- if (ISCOMPLEX(targetTypeId))
- return false;
- continue;
- }
-
/* accept if target is ANY */
if (targetTypeId == ANYOID)
continue;
}
/*
+ * If input is an untyped string constant, assume we can convert
+ * it to anything except a class type.
+ */
+ if (inputTypeId == UNKNOWNOID)
+ {
+ if (ISCOMPLEX(targetTypeId))
+ return false;
+ continue;
+ }
+
+ /*
* If pg_cast shows that we can coerce, accept. This test now
* covers both binary-compatible and coercion-function cases.
*/