Inaccurate comment, for family-1 polymorphic UNKNOWN type arguments

From: Himanshu Upadhyaya <upadhyaya(dot)himanshu(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Inaccurate comment, for family-1 polymorphic UNKNOWN type arguments
Date: 2020-09-07 12:03:49
Message-ID: CAPF61jBUg9XoMPNuLpoZ+h6UZ2VxKdNt3rQL1xw1GOBwjWzAXQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Attachment Content-Type Size
v1-0001-FIX-for-incorrect-comment-for-UNKNOWN-input-type-.patch text/x-patch 872 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Surafel Temesgen 2020-09-07 12:14:45 Re: proposal: possibility to read dumped table's name from file
Previous Message Thomas Munro 2020-09-07 11:40:47 Re: A micro-optimisation for walkdir()