*
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/backend/utils/adt/ri_triggers.c,v 1.114 2009/08/01 19:59:41 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/ri_triggers.c,v 1.115 2009/11/05 04:38:29 tgl Exp $
*
* ----------
*/
{
/*
* The declared input type of the eq_opr might be a
- * polymorphic type such as ANYARRAY or ANYENUM. If so,
- * assume the coercion is valid; otherwise complain.
+ * polymorphic type such as ANYARRAY or ANYENUM, or other
+ * special cases such as RECORD; find_coercion_pathway
+ * currently doesn't subsume these special cases.
*/
- if (!IsPolymorphicType(lefttype))
+ if (!IsPolymorphicType(lefttype) &&
+ !IsBinaryCoercible(typeid, lefttype))
elog(ERROR, "no conversion function from %s to %s",
format_type_be(typeid),
format_type_be(lefttype));