Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitacc67ff

Browse files
committed
Give more accurate error message for dropping pinned portal
The previous code gave the same error message for attempting to droppinned and active portals, but those are separate states, so giveseparate error messages.
1 parentd16c2de commitacc67ff

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)

[8]ページ先頭

©2009-2025 Movatter.jp