mirror of
https://github.com/postgres/postgres.git
synced 2025-11-22 12:22:45 +03:00
Hide internal error for pg_collation_actual_version(<bad OID>).
Instead of an unsightly internal "cache lookup failed" message, just return NULL for bad OIDs, as is the convention for other similar things. Reported-by: Justin Pryzby <pryzby@telsasoft.com> Reviewed-by: Michael Paquier <michael@paquier.xyz> Discussion: https://postgr.es/m/20210117215940.GE8560%40telsasoft.com
This commit is contained in:
@@ -1290,7 +1290,8 @@ do_collation_version_check(const ObjectAddress *otherObject,
|
||||
return false;
|
||||
|
||||
/* Ask the provider for the current version. Give up if unsupported. */
|
||||
current_version = get_collation_version_for_oid(otherObject->objectId);
|
||||
current_version = get_collation_version_for_oid(otherObject->objectId,
|
||||
false);
|
||||
if (!current_version)
|
||||
return false;
|
||||
|
||||
@@ -1369,7 +1370,7 @@ do_collation_version_update(const ObjectAddress *otherObject,
|
||||
if (OidIsValid(*coll) && otherObject->objectId != *coll)
|
||||
return false;
|
||||
|
||||
*new_version = get_collation_version_for_oid(otherObject->objectId);
|
||||
*new_version = get_collation_version_for_oid(otherObject->objectId, false);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user