summaryrefslogtreecommitdiff
path: root/src/backend/tcop/postgres.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/tcop/postgres.c')
-rw-r--r--src/backend/tcop/postgres.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index e43846eedf..4da4748033 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.562 2008/12/13 02:29:21 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.563 2009/01/01 17:12:16 tgl Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
@@ -1714,12 +1714,11 @@ exec_bind_message(StringInfo input_message)
cplan = NULL;
}
- /* Done with the snapshot used for parameter I/O and parsing/planning */
- if (snapshot_set)
- PopActiveSnapshot();
-
/*
- * Define portal and start execution.
+ * Now we can define the portal.
+ *
+ * DO NOT put any code that could possibly throw an error between the
+ * above "RevalidateCachedPlan(psrc, false)" call and here.
*/
PortalDefineQuery(portal,
saved_stmt_name,
@@ -1728,6 +1727,13 @@ exec_bind_message(StringInfo input_message)
plan_list,
cplan);
+ /* Done with the snapshot used for parameter I/O and parsing/planning */
+ if (snapshot_set)
+ PopActiveSnapshot();
+
+ /*
+ * And we're ready to start portal execution.
+ */
PortalStart(portal, params, InvalidSnapshot);
/*