Commit 2b93e3d9 authored by Alvaro Herrera's avatar Alvaro Herrera

makeArrayTypeName: Remove pointless relation open/close

Discussion: https://postgr.es/m/20191218221326.GA25537@alvherre.pgsql
parent 54fbd155
...@@ -785,15 +785,12 @@ makeArrayTypeName(const char *typeName, Oid typeNamespace) ...@@ -785,15 +785,12 @@ makeArrayTypeName(const char *typeName, Oid typeNamespace)
{ {
char *arr = (char *) palloc(NAMEDATALEN); char *arr = (char *) palloc(NAMEDATALEN);
int namelen = strlen(typeName); int namelen = strlen(typeName);
Relation pg_type_desc;
int i; int i;
/* /*
* The idea is to prepend underscores as needed until we make a name that * The idea is to prepend underscores as needed until we make a name that
* doesn't collide with anything... * doesn't collide with anything...
*/ */
pg_type_desc = table_open(TypeRelationId, AccessShareLock);
for (i = 1; i < NAMEDATALEN - 1; i++) for (i = 1; i < NAMEDATALEN - 1; i++)
{ {
arr[i - 1] = '_'; arr[i - 1] = '_';
...@@ -810,8 +807,6 @@ makeArrayTypeName(const char *typeName, Oid typeNamespace) ...@@ -810,8 +807,6 @@ makeArrayTypeName(const char *typeName, Oid typeNamespace)
break; break;
} }
table_close(pg_type_desc, AccessShareLock);
if (i >= NAMEDATALEN - 1) if (i >= NAMEDATALEN - 1)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_DUPLICATE_OBJECT), (errcode(ERRCODE_DUPLICATE_OBJECT),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment