Content-Length: 280979 | pFad | http://github.com/postgrespro/postgres_cluster/commit/acc67ffd0a8c728b928958e75b76ee544b64c2d8

87 Give more accurate error message for dropping pinned portal · postgrespro/postgres_cluster@acc67ff · GitHub
Skip to content

Commit acc67ff

Browse files
committed
Give more accurate error message for dropping pinned portal
The previous code gave the same error message for attempting to drop pinned and active portals, but those are separate states, so give separate error messages.
1 parent d16c2de commit acc67ff

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/backend/utils/mmgr/portalmem.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -464,11 +464,17 @@ PortalDrop(Portal portal, bool isTopCommit)
464464

465465
/*
466466
* Don't allow dropping a pinned portal, it's still needed by whoever
467-
* pinned it. Not sure if the PORTAL_ACTIVE case can validly happen or
468-
* not...
467+
* pinned it.
469468
*/
470-
if (portal->portalPinned ||
471-
portal->status == PORTAL_ACTIVE)
469+
if (portal->portalPinned)
470+
ereport(ERROR,
471+
(errcode(ERRCODE_INVALID_CURSOR_STATE),
472+
errmsg("cannot drop pinned portal \"%s\"", portal->name)));
473+
474+
/*
475+
* Not sure if the PORTAL_ACTIVE case can validly happen or not...
476+
*/
477+
if (portal->status == PORTAL_ACTIVE)
472478
ereport(ERROR,
473479
(errcode(ERRCODE_INVALID_CURSOR_STATE),
474480
errmsg("cannot drop active portal \"%s\"", portal->name)));

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres_cluster/commit/acc67ffd0a8c728b928958e75b76ee544b64c2d8

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy