Hi Hackers,

I observed that we have inaccurate comment in
enforce_generic_type_consistency.

 if (!OidIsValid(elem_typeid))
                {
                        if (allow_poly)
                        {
                                elem_typeid = ANYELEMENTOID;
                                array_typeid = ANYARRAYOID;
                                range_typeid = ANYRANGEOID;
                        }
                        else
                        {
                                /*
                                 * Only way to get here is if all the
polymorphic args have
                                 * UNKNOWN inputs
                                 */
                                *ereport(ERROR, *
                              ...............
                         }
........
}
We reach the error condition even if there is any "anycompatible" parameter
is present (and that is of some known type say int32).
I think developer intend to report error if "we have all the family-1
polymorphic arguments as UNKNOWN".

Thoughts?

Please find attached the patch to fix this typo.

Thanks,
Himanshu
EnterpriseDB: http://www.enterprisedb.com
From 361b8aac87fb3d4e4c968555459f1cedec489440 Mon Sep 17 00:00:00 2001
From: Himanshu Upadhyaya <himanshu.upadhy...@enterprisedb.com>
Date: Mon, 7 Sep 2020 16:48:22 +0530
Subject: [PATCH v1] FIX- for incorrect comment for UNKNOWN input type for
 polymorphic arguments

---
 src/backend/parser/parse_coerce.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backend/parser/parse_coerce.c b/src/backend/parser/parse_coerce.c
index 1b11cf731c..36d6483c24 100644
--- a/src/backend/parser/parse_coerce.c
+++ b/src/backend/parser/parse_coerce.c
@@ -2155,7 +2155,7 @@ enforce_generic_type_consistency(const Oid *actual_arg_types,
 			else
 			{
 				/*
-				 * Only way to get here is if all the polymorphic args have
+				 * Only way to get here is if all the family-1 polymorphic args have
 				 * UNKNOWN inputs
 				 */
 				ereport(ERROR,
-- 
2.25.1

Reply via email to