diff -rcN postgresql-8.3.12/src/backend/tcop/postgres.c postgresql-8.3.12_dev/src/backend/tcop/postgres.c *** postgresql-8.3.12/src/backend/tcop/postgres.c 2010-10-01 22:36:12.000000000 +0900 --- postgresql-8.3.12_dev/src/backend/tcop/postgres.c 2010-12-16 15:46:43.000000000 +0900 *************** *** 914,919 **** --- 914,921 ---- /* * Set up a snapshot if parse analysis/planning will need one. */ + oldcontext = MemoryContextSwitchTo(MessageContext); + if (analyze_requires_snapshot(parsetree)) { mySnapshot = CopySnapshot(GetTransactionSnapshot()); *************** *** 926,932 **** * Switch to appropriate context for constructing querytrees (again, * these must outlive the execution context). */ - oldcontext = MemoryContextSwitchTo(MessageContext); querytree_list = pg_analyze_and_rewrite(parsetree, query_string, NULL, 0); --- 928,933 ----