From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Use <unnamed> for name of unnamed portal's memory context
Date: Sat, 5 Sep 2020 08:14:14 +0200
Message-ID: <ccb353ef-89ff-09b3-8046-1d2514624b9c@2ndquadrant.com> (raw)
I propose the attached little patch to set the name of the memory
context of an unnamed portal to "<unnamed>" instead of just an empty
string. Otherwise the debug memory context dump looks a little
confusing. We use this convention elsewhere for making unnamed
statements etc. more clearly visible.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Attachments:0001-Use-unnamed-for-name-of-unnamed-portal-s-memory-cont.patch (text/plain, 981B) download
From 409abc15293efdc8ec65db77efa40d2d9517ad0b Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter@eisentraut.org>
Date: Sat, 5 Sep 2020 08:09:51 +0200
Subject: [PATCH] Use <unnamed> for name of unnamed portal's memory context
Otherwise just printing an empty string makes the memory context debug
output slightly confusing.
---
src/backend/utils/mmgr/portalmem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/backend/utils/mmgr/portalmem.c b/src/backend/utils/mmgr/portalmem.cindex 7072ce48a3..bee81368aa 100644--- a/src/backend/utils/mmgr/portalmem.c+++ b/src/backend/utils/mmgr/portalmem.c@@ -221,7 +221,7 @@ CreatePortal(const char *name, bool allowDup, bool dupSilent)
PortalHashTableInsert(portal, name);
/* reuse portal->name copy */
- MemoryContextSetIdentifier(portal->portalContext, portal->name);+ MemoryContextSetIdentifier(portal->portalContext, portal->name[0] ? portal->name : "<unnamed>");
return portal;
}
--
2.28.0
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: peter.eisentraut@2ndquadrant.com
Subject: Re: Use <unnamed> for name of unnamed portal's memory context
In-Reply-To: <ccb353ef-89ff-09b3-8046-1d2514624b9c@2ndquadrant.com>
References: <ccb353ef-89ff-09b3-8046-1d2514624b9c@2ndquadrant.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox