Add memory context identifier to portal context
authorPeter Eisentraut <[email protected]>
Fri, 6 Apr 2018 16:34:15 +0000 (12:34 -0400)
committerPeter Eisentraut <[email protected]>
Fri, 6 Apr 2018 16:37:54 +0000 (12:37 -0400)
Discussion: https://www.postgresql.org/message-id/6421.1522194949@sss.pgh.pa.us

src/backend/utils/mmgr/portalmem.c

index 4307f5cc70fd843ae78ac7e1c5a751f44e91e775..53225d6f1b4020f1cb3f18bfbedcf51603d8baa7 100644 (file)
@@ -220,6 +220,9 @@ CreatePortal(const char *name, bool allowDup, bool dupSilent)
        /* put portal in table (sets portal->name) */
        PortalHashTableInsert(portal, name);
 
+       /* reuse portal->name copy */
+       MemoryContextSetIdentifier(portal->portalContext, portal->name);
+
        return portal;
 }