From c1f3073333d01987ac9c3e5f6c197b9e2afc3ba9 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 30 Nov 2008 20:51:25 +0000 Subject: 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. --- src/backend/tcop/postgres.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/backend/tcop/postgres.c') 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 -- cgit v1.2.3