diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2009-12-29 17:40:59 +0000 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2009-12-29 17:40:59 +0000 |
commit | 84d723b6cefcf25b8c800f8aa6cf3c9538a546b4 (patch) | |
tree | fa91ab7b2bc60f3d602a330bc68b78ae8beab69b /src/backend/executor/nodeWindowAgg.c | |
parent | 50ef9f7b0612c755097bbddd7f2985237030c31a (diff) | |
download | postgresql-84d723b6cefcf25b8c800f8aa6cf3c9538a546b4.tar.gz postgresql-84d723b6cefcf25b8c800f8aa6cf3c9538a546b4.zip |
Previous fix for temporary file management broke returning a set from
PL/pgSQL function within an exception handler. Make sure we use the right
resource owner when we create the tuplestore to hold returned tuples.
Simplify tuplestore API so that the caller doesn't need to be in the right
memory context when calling tuplestore_put* functions. tuplestore.c
automatically switches to the memory context used when the tuplestore was
created. Tuplesort was already modified like this earlier. This patch also
removes the now useless MemoryContextSwitch calls from callers.
Report by Aleksei on pgsql-bugs on Dec 22 2009. Backpatch to 8.1, like
the previous patch that broke this.
Diffstat (limited to 'src/backend/executor/nodeWindowAgg.c')
-rw-r--r-- | src/backend/executor/nodeWindowAgg.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/executor/nodeWindowAgg.c b/src/backend/executor/nodeWindowAgg.c index acc2f55ea94..ea28e09eae2 100644 --- a/src/backend/executor/nodeWindowAgg.c +++ b/src/backend/executor/nodeWindowAgg.c @@ -27,7 +27,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/executor/nodeWindowAgg.c,v 1.7 2009/09/27 21:10:53 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/executor/nodeWindowAgg.c,v 1.8 2009/12/29 17:40:59 heikki Exp $ * *------------------------------------------------------------------------- */ @@ -723,7 +723,7 @@ spool_tuples(WindowAggState *winstate, int64 pos) outerPlan = outerPlanState(winstate); - /* Must be in query context to call outerplan or touch tuplestore */ + /* Must be in query context to call outerplan */ oldcontext = MemoryContextSwitchTo(winstate->ss.ps.ps_ExprContext->ecxt_per_query_memory); while (winstate->spooled_rows <= pos || pos == -1) |