diff options
| author | Heikki Linnakangas | 2009-12-29 17:40:59 +0000 |
|---|---|---|
| committer | Heikki Linnakangas | 2009-12-29 17:40:59 +0000 |
| commit | 84d723b6cefcf25b8c800f8aa6cf3c9538a546b4 (patch) | |
| tree | fa91ab7b2bc60f3d602a330bc68b78ae8beab69b /contrib/dblink | |
| parent | 50ef9f7b0612c755097bbddd7f2985237030c31a (diff) | |
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 'contrib/dblink')
| -rw-r--r-- | contrib/dblink/dblink.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/contrib/dblink/dblink.c b/contrib/dblink/dblink.c index 61585644f92..d3875529fd0 100644 --- a/contrib/dblink/dblink.c +++ b/contrib/dblink/dblink.c @@ -8,7 +8,7 @@ * Darko Prenosil <Darko.Prenosil@finteh.hr> * Shridhar Daithankar <shridhar_daithankar@persistent.co.in> * - * $PostgreSQL: pgsql/contrib/dblink/dblink.c,v 1.84 2009/09/12 23:20:52 joe Exp $ + * $PostgreSQL: pgsql/contrib/dblink/dblink.c,v 1.85 2009/12/29 17:40:59 heikki Exp $ * Copyright (c) 2001-2009, PostgreSQL Global Development Group * ALL RIGHTS RESERVED; * @@ -1703,10 +1703,7 @@ dblink_get_notify(PG_FUNCTION_ARGS) else nulls[2] = true; - /* switch to appropriate context while storing the tuple */ - MemoryContextSwitchTo(per_query_ctx); tuplestore_putvalues(tupstore, tupdesc, values, nulls); - MemoryContextSwitchTo(oldcontext); PQfreemem(notify); PQconsumeInput(conn); |
