*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/parser/parse_coerce.c,v 2.127 2005/03/29 00:17:04 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/parser/parse_coerce.c,v 2.128 2005/05/05 00:19:47 tgl Exp $
*
*-------------------------------------------------------------------------
*/
return coerce_record_to_complex(pstate, node, targetTypeId,
ccontext, cformat);
}
+ if (targetTypeId == RECORDOID &&
+ ISCOMPLEX(inputTypeId))
+ {
+ /* Coerce a specific complex type to RECORD */
+ /* NB: we do NOT want a RelabelType here */
+ return node;
+ }
if (typeInheritsFrom(inputTypeId, targetTypeId))
{
/*
ISCOMPLEX(targetTypeId))
continue;
+ /*
+ * If input is a composite type and target is RECORD, accept
+ */
+ if (targetTypeId == RECORDOID &&
+ ISCOMPLEX(inputTypeId))
+ continue;
+
/*
* If input is a class type that inherits from target, accept
*/