mirror of
https://github.com/postgres/postgres.git
synced 2025-08-31 17:02: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:
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* Copyright (c) 2002-2003, PostgreSQL Global Development Group
|
||||
*
|
||||
* $Id: prepare.h,v 1.4 2003/05/05 00:44:56 tgl Exp $
|
||||
* $Id: prepare.h,v 1.5 2003/05/06 20:26:27 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -42,7 +42,7 @@ typedef struct
|
||||
|
||||
/* Utility statements PREPARE, EXECUTE, DEALLOCATE, EXPLAIN EXECUTE */
|
||||
extern void PrepareQuery(PrepareStmt *stmt);
|
||||
extern void ExecuteQuery(ExecuteStmt *stmt, CommandDest outputDest);
|
||||
extern void ExecuteQuery(ExecuteStmt *stmt, DestReceiver *dest);
|
||||
extern void DeallocateQuery(DeallocateStmt *stmt);
|
||||
extern void ExplainExecuteQuery(ExplainStmt *stmt, TupOutputState *tstate);
|
||||
|
||||
|
Reference in New Issue
Block a user