mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +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: printtup.h,v 1.25 2003/05/06 00:20:33 tgl Exp $
|
||||
* $Id: printtup.h,v 1.26 2003/05/06 20:26:27 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -16,19 +16,19 @@
|
||||
|
||||
#include "tcop/dest.h"
|
||||
|
||||
extern DestReceiver *printtup_create_DR(bool isBinary, bool sendDescrip);
|
||||
extern DestReceiver *printtup_create_DR(CommandDest dest);
|
||||
|
||||
extern void SendRowDescriptionMessage(TupleDesc typeinfo, List *targetlist);
|
||||
|
||||
extern void debugSetup(DestReceiver *self, int operation,
|
||||
extern void debugStartup(DestReceiver *self, int operation,
|
||||
const char *portalName, TupleDesc typeinfo, List *targetlist);
|
||||
extern void debugtup(HeapTuple tuple, TupleDesc typeinfo,
|
||||
DestReceiver *self);
|
||||
|
||||
/* XXX these are really in executor/spi.c */
|
||||
extern void spi_dest_setup(DestReceiver *self, int operation,
|
||||
extern void spi_dest_startup(DestReceiver *self, int operation,
|
||||
const char *portalName, TupleDesc typeinfo, List *targetlist);
|
||||
extern void spi_printtup(HeapTuple tuple, TupleDesc tupdesc,
|
||||
extern void spi_printtup(HeapTuple tuple, TupleDesc typeinfo,
|
||||
DestReceiver *self);
|
||||
|
||||
#endif /* PRINTTUP_H */
|
||||
|
Reference in New Issue
Block a user