Skip to content

Commit 728d4bc

Browse files
committed
Use <unnamed> for name of unnamed portal's memory context
Otherwise just printing an empty string makes the memory context debug output slightly confusing. Discussion: https://www.postgresql.org/message-id/flat/ccb353ef-89ff-09b3-8046-1d2514624b9c%402ndquadrant.com
1 parent 1dec091 commit 728d4bc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/utils/mmgr/portalmem.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,8 @@ CreatePortal(const char *name, bool allowDup, bool dupSilent)
220220
/* put portal in table (sets portal->name) */
221221
PortalHashTableInsert(portal, name);
222222

223-
/* reuse portal->name copy */
224-
MemoryContextSetIdentifier(portal->portalContext, portal->name);
223+
/* for named portals reuse portal->name copy */
224+
MemoryContextSetIdentifier(portal->portalContext, portal->name[0] ? portal->name : "<unnamed>");
225225

226226
return portal;
227227
}

0 commit comments

Comments
 (0)