mirror of
https://github.com/postgres/postgres.git
synced 2025-11-19 13:42:17 +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:
@@ -35,6 +35,12 @@
|
||||
* The same receiver object may be re-used multiple times; eventually it is
|
||||
* destroyed by calling its rDestroy method.
|
||||
*
|
||||
* In some cases, receiver objects require additional parameters that must
|
||||
* be passed to them after calling CreateDestReceiver. Since the set of
|
||||
* parameters varies for different receiver types, this is not handled by
|
||||
* this module, but by direct calls from the calling code to receiver type
|
||||
* specific functions.
|
||||
*
|
||||
* The DestReceiver object returned by CreateDestReceiver may be a statically
|
||||
* allocated object (for destination types that require no local state),
|
||||
* in which case rDestroy is a no-op. Alternatively it can be a palloc'd
|
||||
@@ -54,7 +60,7 @@
|
||||
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/tcop/dest.h,v 1.55 2008/10/31 19:37:56 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/include/tcop/dest.h,v 1.56 2008/11/30 20:51:25 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -120,14 +126,10 @@ struct _DestReceiver
|
||||
|
||||
extern DestReceiver *None_Receiver; /* permanent receiver for DestNone */
|
||||
|
||||
/* This is a forward reference to utils/portal.h */
|
||||
|
||||
typedef struct PortalData *Portal;
|
||||
|
||||
/* The primary destination management functions */
|
||||
|
||||
extern void BeginCommand(const char *commandTag, CommandDest dest);
|
||||
extern DestReceiver *CreateDestReceiver(CommandDest dest, Portal portal);
|
||||
extern DestReceiver *CreateDestReceiver(CommandDest dest);
|
||||
extern void EndCommand(const char *commandTag, CommandDest dest);
|
||||
|
||||
/* Additional functions that go with destination management, more or less. */
|
||||
|
||||
Reference in New Issue
Block a user