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 a88a054fb4d..697430e927f 100644
--- a/src/backend/tcop/pquery.c
+++ b/src/backend/tcop/pquery.c
@@ -1755,7 +1755,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 */