aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/portalcmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/commands/portalcmds.c')
-rw-r--r--src/backend/commands/portalcmds.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/src/backend/commands/portalcmds.c b/src/backend/commands/portalcmds.c
index b36473fba44..76d6cf154c6 100644
--- a/src/backend/commands/portalcmds.c
+++ b/src/backend/commands/portalcmds.c
@@ -294,21 +294,13 @@ PortalCleanup(Portal portal)
/* We must make the portal's resource owner current */
saveResourceOwner = CurrentResourceOwner;
- PG_TRY();
- {
- if (portal->resowner)
- CurrentResourceOwner = portal->resowner;
- ExecutorFinish(queryDesc);
- ExecutorEnd(queryDesc);
- FreeQueryDesc(queryDesc);
- }
- PG_CATCH();
- {
- /* Ensure CurrentResourceOwner is restored on error */
- CurrentResourceOwner = saveResourceOwner;
- PG_RE_THROW();
- }
- PG_END_TRY();
+ if (portal->resowner)
+ CurrentResourceOwner = portal->resowner;
+
+ ExecutorFinish(queryDesc);
+ ExecutorEnd(queryDesc);
+ FreeQueryDesc(queryDesc);
+
CurrentResourceOwner = saveResourceOwner;
}
}