mirror of
https://github.com/postgres/postgres.git
synced 2025-08-25 20:23:07 +03:00
Restructure command destination handling so that we pass around
DestReceiver pointers instead of just CommandDest values. The DestReceiver is made at the point where the destination is selected, rather than deep inside the executor. This cleans up the original kluge implementation of tstoreReceiver.c, and makes it easy to support retrieving results from utility statements inside portals. Thus, you can now do fun things like Bind and Execute a FETCH or EXPLAIN command, and it'll all work as expected (e.g., you can Describe the portal, or use Execute's count parameter to suspend the output partway through). Implementation involves stuffing the utility command's output into a Tuplestore, which would be kind of annoying for huge output sets, but should be quite acceptable for typical uses of utility commands.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: execdesc.h,v 1.22 2002/12/15 16:17:54 tgl Exp $
|
||||
* $Id: execdesc.h,v 1.23 2003/05/06 20:26:28 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -33,7 +33,7 @@ typedef struct QueryDesc
|
||||
CmdType operation; /* CMD_SELECT, CMD_UPDATE, etc. */
|
||||
Query *parsetree; /* rewritten parsetree */
|
||||
Plan *plantree; /* planner's output */
|
||||
CommandDest dest; /* the destination output of the execution */
|
||||
DestReceiver *dest; /* the destination for tuple output */
|
||||
const char *portalName; /* name of portal, or NULL */
|
||||
ParamListInfo params; /* param values being passed in */
|
||||
bool doInstrument; /* TRUE requests runtime instrumentation */
|
||||
@@ -46,7 +46,7 @@ typedef struct QueryDesc
|
||||
|
||||
/* in pquery.c */
|
||||
extern QueryDesc *CreateQueryDesc(Query *parsetree, Plan *plantree,
|
||||
CommandDest dest, const char *portalName,
|
||||
DestReceiver *dest, const char *portalName,
|
||||
ParamListInfo params,
|
||||
bool doInstrument);
|
||||
|
||||
|
Reference in New Issue
Block a user