aboutsummaryrefslogtreecommitdiff
path: root/src/backend/tcop/postgres.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2008-11-30 20:51:25 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2008-11-30 20:51:25 +0000
commitc1f3073333d01987ac9c3e5f6c197b9e2afc3ba9 (patch)
treeb70ddff5404c442ec13a5c182346984d4300f6da /src/backend/tcop/postgres.c
parent3f936aacc057e4b391ab953fea2ffb689a12a8bc (diff)
downloadpostgresql-c1f3073333d01987ac9c3e5f6c197b9e2afc3ba9.tar.gz
postgresql-c1f3073333d01987ac9c3e5f6c197b9e2afc3ba9.zip
Clean up the API for DestReceiver objects by eliminating the assumption
that a Portal is a useful and sufficient additional argument for CreateDestReceiver --- it just isn't, in most cases. Instead formalize the approach of passing any needed parameters to the receiver separately. One unexpected benefit of this change is that we can declare typedef Portal in a less surprising location. This patch is just code rearrangement and doesn't change any functionality. I'll tackle the HOLD-cursor-vs-toast problem in a follow-on patch.
Diffstat (limited to 'src/backend/tcop/postgres.c')
-rw-r--r--src/backend/tcop/postgres.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index c9e7b5e6267..f262b8014ef 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.557 2008/09/30 10:52:13 heikki Exp $
+ * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.558 2008/11/30 20:51:25 tgl Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
@@ -979,7 +979,9 @@ exec_simple_query(const char *query_string)
/*
* Now we can create the destination receiver object.
*/
- receiver = CreateDestReceiver(dest, portal);
+ receiver = CreateDestReceiver(dest);
+ if (dest == DestRemote)
+ SetRemoteDestReceiverParams(receiver, portal);
/*
* Switch back to transaction context for execution.
@@ -1835,7 +1837,9 @@ exec_execute_message(const char *portal_name, long max_rows)
* Create dest receiver in MessageContext (we don't want it in transaction
* context, because that may get deleted if portal contains VACUUM).
*/
- receiver = CreateDestReceiver(dest, portal);
+ receiver = CreateDestReceiver(dest);
+ if (dest == DestRemoteExecute)
+ SetRemoteDestReceiverParams(receiver, portal);
/*
* Ensure we are in a transaction command (this should normally be the