1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-13 07:41:39 +03:00

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.
This commit is contained in:
Tom Lane
2008-11-30 20:51:25 +00:00
parent 3f936aacc0
commit c1f3073333
14 changed files with 108 additions and 83 deletions

View File

@ -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