pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feedUse <unnamed> for name of unnamed portal's memory context
5+ messages / 4 participants
[nested] [flat]
Commits from this thread:
2020-09-08 728d4bc16b Use <unnamed> for name of unnamed portal's memory context
* Use <unnamed> for name of unnamed portal's memory context
@ 2020-09-05 06:14 Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
0 siblings, 1 reply; 5+ messages in thread
From: Peter Eisentraut @ 2020-09-05 06:14 UTC (permalink / raw)
To: pgsql-hackers
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.c
index 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
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Use <unnamed> for name of unnamed portal's memory context
@ 2020-09-05 06:24 Pavel Stehule <pavel.stehule@gmail.com>
parent: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
0 siblings, 1 reply; 5+ messages in thread
From: Pavel Stehule @ 2020-09-05 06:24 UTC (permalink / raw)
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; +Cc: pgsql-hackers
so 5. 9. 2020 v 8:14 odesÃlatel Peter Eisentraut <
peter.eisentraut@2ndquadrant.com> napsal:
> 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.
>
+1
Pavel
>
> --
> Peter Eisentraut http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
>
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Use <unnamed> for name of unnamed portal's memory context
@ 2020-09-05 06:55 Julien Rouhaud <rjuju123@gmail.com>
parent: Pavel Stehule <pavel.stehule@gmail.com>
0 siblings, 1 reply; 5+ messages in thread
From: Julien Rouhaud @ 2020-09-05 06:55 UTC (permalink / raw)
To: Pavel Stehule <pavel.stehule@gmail.com>; +Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; pgsql-hackers
On Sat, Sep 5, 2020 at 8:25 AM Pavel Stehule <pavel.stehule@gmail.com> wrote:
>
> so 5. 9. 2020 v 8:14 odesÃlatel Peter Eisentraut <peter.eisentraut@2ndquadrant.com> napsal:
>>
>> 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.
>
>
> +1
+1 too, and obviously patch looks good.
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Use <unnamed> for name of unnamed portal's memory context
@ 2020-09-05 15:10 Tom Lane <tgl@sss.pgh.pa.us>
parent: Julien Rouhaud <rjuju123@gmail.com>
0 siblings, 1 reply; 5+ messages in thread
From: Tom Lane @ 2020-09-05 15:10 UTC (permalink / raw)
To: Julien Rouhaud <rjuju123@gmail.com>; +Cc: Pavel Stehule <pavel.stehule@gmail.com>; Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; pgsql-hackers
Julien Rouhaud <rjuju123@gmail.com> writes:
> +1 too, and obviously patch looks good.
The adjacent comment needs updating.
regards, tom lane
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Use <unnamed> for name of unnamed portal's memory context
@ 2020-09-08 15:25 Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 5+ messages in thread
From: Peter Eisentraut @ 2020-09-08 15:25 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; Julien Rouhaud <rjuju123@gmail.com>; +Cc: Pavel Stehule <pavel.stehule@gmail.com>; pgsql-hackers
On 2020-09-05 17:10, Tom Lane wrote:
> Julien Rouhaud <rjuju123@gmail.com> writes:
>> +1 too, and obviously patch looks good.
>
> The adjacent comment needs updating.
committed with that change
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2020-09-08 15:25 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-09-05 06:14 Use <unnamed> for name of unnamed portal's memory context Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
2020-09-05 06:24 ` Pavel Stehule <pavel.stehule@gmail.com>
2020-09-05 06:55 ` Julien Rouhaud <rjuju123@gmail.com>
2020-09-05 15:10 ` Tom Lane <tgl@sss.pgh.pa.us>
2020-09-08 15:25 ` Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
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