Commit bc8036fc666a (12 years ago) seems to have introduced an
unnecessary catalog heap_open/close in order to do syscache accesses.
I presume a preliminary version of the patch used sysscans or something.
I don't think that's necessary, so this patch removes it.
(I noticed while reading Paul Jungwirth's patch that changes how this
works.)
--
Álvaro Herrera Developer, https://www.PostgreSQL.org/
diff --git a/src/backend/catalog/pg_type.c b/src/backend/catalog/pg_type.c
index a8c1de511f..53bd8d104c 100644
--- a/src/backend/catalog/pg_type.c
+++ b/src/backend/catalog/pg_type.c
@@ -785,14 +785,12 @@ makeArrayTypeName(const char *typeName, Oid typeNamespace)
{
char *arr = (char *) palloc(NAMEDATALEN);
int namelen = strlen(typeName);
- Relation pg_type_desc;
int i;
/*
* The idea is to prepend underscores as needed until we make a name that
* doesn't collide with anything...
*/
- pg_type_desc = table_open(TypeRelationId, AccessShareLock);
for (i = 1; i < NAMEDATALEN - 1; i++)
{
@@ -810,7 +808,6 @@ makeArrayTypeName(const char *typeName, Oid typeNamespace)
break;
}
- table_close(pg_type_desc, AccessShareLock);
if (i >= NAMEDATALEN - 1)
ereport(ERROR,