From 2b1f5651958c99fa904037942c1fbb04c20d8d2f Mon Sep 17 00:00:00 2001
From: Xiaoran Wang <wxiaoran@vmware.com>
Date: Sat, 18 Mar 2023 14:17:30 +0800
Subject: [PATCH] Use RelationClose rather than table_close in
 heap_create_with_catalog

The Relation new_rel_desc is created by RelationBuildLocalRelation, not
table_open. So it's better to call RelationClose to release it.

What's more, the comment for it seems ueseless, just delete it.
---
 src/backend/catalog/heap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c
index 4f006820b8..5b0e3dc592 100644
--- a/src/backend/catalog/heap.c
+++ b/src/backend/catalog/heap.c
@@ -1484,7 +1484,7 @@ heap_create_with_catalog(const char *relname,
 	 * ok, the relation has been cataloged, so close our relations and return
 	 * the OID of the newly created relation.
 	 */
-	table_close(new_rel_desc, NoLock);	/* do not unlock till end of xact */
+	RelationClose(new_rel_desc);
 	table_close(pg_class_desc, RowExclusiveLock);
 
 	return relid;
-- 
2.32.1 (Apple Git-133)

