mirror of
https://github.com/postgres/postgres.git
synced 2025-06-26 12:21:12 +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:
@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: executor.h,v 1.93 2003/05/06 00:20:33 tgl Exp $
|
||||
* $Id: executor.h,v 1.94 2003/05/06 20:26:28 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -161,16 +161,18 @@ extern TupleTableSlot *ExecInitExtraTupleSlot(EState *estate);
|
||||
extern TupleTableSlot *ExecInitNullTupleSlot(EState *estate,
|
||||
TupleDesc tupType);
|
||||
extern TupleDesc ExecTypeFromTL(List *targetList, bool hasoid);
|
||||
extern TupleDesc ExecCleanTypeFromTL(List *targetList, bool hasoid);
|
||||
extern void UpdateChangedParamSet(PlanState *node, Bitmapset *newchg);
|
||||
|
||||
typedef struct TupOutputState
|
||||
{
|
||||
/* use "struct" here to allow forward reference */
|
||||
struct AttInMetadata *metadata;
|
||||
DestReceiver *destfunc;
|
||||
DestReceiver *dest;
|
||||
} TupOutputState;
|
||||
|
||||
extern TupOutputState *begin_tup_output_tupdesc(CommandDest dest, TupleDesc tupdesc);
|
||||
extern TupOutputState *begin_tup_output_tupdesc(DestReceiver *dest,
|
||||
TupleDesc tupdesc);
|
||||
extern void do_tup_output(TupOutputState *tstate, char **values);
|
||||
extern void do_text_output_multiline(TupOutputState *tstate, char *text);
|
||||
extern void end_tup_output(TupOutputState *tstate);
|
||||
|
Reference in New Issue
Block a user