aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/tcop/pquery.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/tcop/pquery.c b/src/backend/tcop/pquery.c
index c9f63923543..adbaea5ca77 100644
--- a/src/backend/tcop/pquery.c
+++ b/src/backend/tcop/pquery.c
@@ -1779,7 +1779,8 @@ EnsurePortalSnapshotExists(void)
/* Otherwise, we'd better have an active Portal */
portal = ActivePortal;
- Assert(portal != NULL);
+ if (unlikely(portal == NULL))
+ elog(ERROR, "cannot execute SQL without an outer snapshot or portal");
Assert(portal->portalSnapshot == NULL);
/* Create a new snapshot and make it active */