Skip to content

Commit 490a1ef

Browse files
Xiaoran Wanghackorum
authored andcommitted
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.
1 parent d29d469 commit 490a1ef

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/backend/catalog/heap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1544,7 +1544,7 @@ heap_create_with_catalog(const char *relname,
15441544
* ok, the relation has been cataloged, so close our relations and return
15451545
* the OID of the newly created relation.
15461546
*/
1547-
table_close(new_rel_desc, NoLock); /* do not unlock till end of xact */
1547+
RelationClose(new_rel_desc);
15481548
table_close(pg_class_desc, RowExclusiveLock);
15491549

15501550
return relid;

0 commit comments

Comments
 (0)