Skip to content

Commit 8e79277

Browse files
committed
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.
1 parent 6bef82b commit 8e79277

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/backend/utils/adt/ri_triggers.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
1717
*
18-
* $PostgreSQL: pgsql/src/backend/utils/adt/ri_triggers.c,v 1.114 2009/08/01 19:59:41 tgl Exp $
18+
* $PostgreSQL: pgsql/src/backend/utils/adt/ri_triggers.c,v 1.115 2009/11/05 04:38:29 tgl Exp $
1919
*
2020
* ----------
2121
*/
@@ -3963,10 +3963,12 @@ ri_HashCompareOp(Oid eq_opr, Oid typeid)
39633963
{
39643964
/*
39653965
* The declared input type of the eq_opr might be a
3966-
* polymorphic type such as ANYARRAY or ANYENUM. If so,
3967-
* assume the coercion is valid; otherwise complain.
3966+
* polymorphic type such as ANYARRAY or ANYENUM, or other
3967+
* special cases such as RECORD; find_coercion_pathway
3968+
* currently doesn't subsume these special cases.
39683969
*/
3969-
if (!IsPolymorphicType(lefttype))
3970+
if (!IsPolymorphicType(lefttype) &&
3971+
!IsBinaryCoercible(typeid, lefttype))
39703972
elog(ERROR, "no conversion function from %s to %s",
39713973
format_type_be(typeid),
39723974
format_type_be(lefttype));

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy