From 8e792776997698bd1dcf6e1403ed994e3e739f16 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 5 Nov 2009 04:38:29 +0000 Subject: Allow binary-coercible cases in ri_HashCompareOp; there are some such cases that are not handled by find_coercion_pathway, notably composite->RECORD. Now that 8.4 supports composites as primary keys, it's worth dealing with this case. --- src/backend/utils/adt/ri_triggers.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/backend/utils/adt/ri_triggers.c') diff --git a/src/backend/utils/adt/ri_triggers.c b/src/backend/utils/adt/ri_triggers.c index c89553ce0c0..d108d077dbb 100644 --- a/src/backend/utils/adt/ri_triggers.c +++ b/src/backend/utils/adt/ri_triggers.c @@ -15,7 +15,7 @@ * * 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 $ * * ---------- */ @@ -3963,10 +3963,12 @@ ri_HashCompareOp(Oid eq_opr, Oid typeid) { /* * 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)); -- cgit v1.2.3