mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-01 11:07:25 +02:00
Clarify comments in enforce_generic_type_consistency().
Some of the pre-existing comments were vague about whether they referred to all polymorphic types or only the old-style ones. Also be more consistent about using the "family 1" vs "family 2" terminology. Himanshu Upadhyaya and Tom Lane Discussion: https://postgr.es/m/CAPF61jBUg9XoMPNuLpoZ+h6UZ2VxKdNt3rQL1xw1GOBwjWzAXQ@mail.gmail.com
This commit is contained in:
parent
1e83138da1
commit
e02c99bff6
@ -2155,8 +2155,8 @@ enforce_generic_type_consistency(const Oid *actual_arg_types,
|
|||||||
else
|
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
|
||||||
* UNKNOWN inputs
|
* arguments have UNKNOWN inputs.
|
||||||
*/
|
*/
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_DATATYPE_MISMATCH),
|
(errcode(ERRCODE_DATATYPE_MISMATCH),
|
||||||
@ -2254,10 +2254,10 @@ enforce_generic_type_consistency(const Oid *actual_arg_types,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Only way to get here is if all the ANYCOMPATIBLE args have
|
* Only way to get here is if all the family-2 polymorphic
|
||||||
* UNKNOWN inputs. Resolve to TEXT as select_common_type()
|
* arguments have UNKNOWN inputs. Resolve to TEXT as
|
||||||
* would do. That doesn't license us to use TEXTRANGE,
|
* select_common_type() would do. That doesn't license us to
|
||||||
* though.
|
* use TEXTRANGE, though.
|
||||||
*/
|
*/
|
||||||
anycompatible_typeid = TEXTOID;
|
anycompatible_typeid = TEXTOID;
|
||||||
anycompatible_array_typeid = TEXTARRAYOID;
|
anycompatible_array_typeid = TEXTARRAYOID;
|
||||||
@ -2269,7 +2269,7 @@ enforce_generic_type_consistency(const Oid *actual_arg_types,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* replace polymorphic types by selected types */
|
/* replace family-2 polymorphic types by selected types */
|
||||||
for (int j = 0; j < nargs; j++)
|
for (int j = 0; j < nargs; j++)
|
||||||
{
|
{
|
||||||
Oid decl_type = declared_arg_types[j];
|
Oid decl_type = declared_arg_types[j];
|
||||||
@ -2285,11 +2285,11 @@ enforce_generic_type_consistency(const Oid *actual_arg_types,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If we had any UNKNOWN inputs for polymorphic arguments, re-scan to
|
* If we had any UNKNOWN inputs for family-1 polymorphic arguments,
|
||||||
* assign correct types to them.
|
* re-scan to assign correct types to them.
|
||||||
*
|
*
|
||||||
* Note: we don't have to consider unknown inputs that were matched to
|
* Note: we don't have to consider unknown inputs that were matched to
|
||||||
* ANYCOMPATIBLE-family arguments, because we forcibly updated their
|
* family-2 polymorphic arguments, because we forcibly updated their
|
||||||
* declared_arg_types[] positions just above.
|
* declared_arg_types[] positions just above.
|
||||||
*/
|
*/
|
||||||
if (have_poly_unknowns)
|
if (have_poly_unknowns)
|
||||||
|
Loading…
Reference in New Issue
Block a user