*** pgsql/src/backend/tcop/postgres.c 2008/12/13 02:29:21 1.562 --- pgsql/src/backend/tcop/postgres.c 2009/01/01 17:12:16 1.563 *************** *** 8,14 **** * * * IDENTIFICATION ! * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.561 2008/12/13 02:00:19 tgl Exp $ * * NOTES * this is the "main" module of the postgres backend and --- 8,14 ---- * * * IDENTIFICATION ! * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.562 2008/12/13 02:29:21 tgl Exp $ * * NOTES * this is the "main" module of the postgres backend and *************** exec_bind_message(StringInfo input_messa *** 1714,1725 **** cplan = NULL; } - /* Done with the snapshot used for parameter I/O and parsing/planning */ - if (snapshot_set) - PopActiveSnapshot(); - /* ! * Define portal and start execution. */ PortalDefineQuery(portal, saved_stmt_name, --- 1714,1724 ---- cplan = NULL; } /* ! * 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, *************** exec_bind_message(StringInfo input_messa *** 1728,1733 **** --- 1727,1739 ---- 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); /*