summaryrefslogtreecommitdiff
path: root/src/include/tcop
diff options
context:
space:
mode:
authorTom Lane2003-05-08 18:16:37 +0000
committerTom Lane2003-05-08 18:16:37 +0000
commitc0a8c3ac13f84602a46ba25b9a2fd5427514f61a (patch)
treef321719251471a05a768117f35010d28076f938a /src/include/tcop
parent5e7a5c9511b65d483639dd3f7dfab7b9e92c3433 (diff)
Update 3.0 protocol support to match recent agreements about how to
handle multiple 'formats' for data I/O. Restructure CommandDest and DestReceiver stuff one more time (it's finally starting to look a bit clean though). Code now matches latest 3.0 protocol document as far as message formats go --- but there is no support for binary I/O yet.
Diffstat (limited to 'src/include/tcop')
-rw-r--r--src/include/tcop/dest.h25
-rw-r--r--src/include/tcop/pquery.h6
2 files changed, 17 insertions, 14 deletions
diff --git a/src/include/tcop/dest.h b/src/include/tcop/dest.h
index d2162e99760..b5721f4593f 100644
--- a/src/include/tcop/dest.h
+++ b/src/include/tcop/dest.h
@@ -54,7 +54,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: dest.h,v 1.37 2003/05/06 20:26:28 tgl Exp $
+ * $Id: dest.h,v 1.38 2003/05/08 18:16:37 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -82,12 +82,9 @@ typedef enum
None, /* results are discarded */
Debug, /* results go to debugging output */
Remote, /* results sent to frontend process */
- RemoteInternal, /* results sent to frontend process in
- * internal (binary) form */
- SPI, /* results sent to SPI manager */
- Tuplestore, /* results sent to Tuplestore */
RemoteExecute, /* sent to frontend, in Execute command */
- RemoteExecuteInternal /* same, but binary format */
+ SPI, /* results sent to SPI manager */
+ Tuplestore /* results sent to Tuplestore */
} CommandDest;
/* ----------------
@@ -106,13 +103,13 @@ typedef struct _DestReceiver DestReceiver;
struct _DestReceiver
{
/* Called for each tuple to be output: */
- void (*receiveTuple) (HeapTuple tuple, TupleDesc typeinfo,
+ void (*receiveTuple) (HeapTuple tuple,
+ TupleDesc typeinfo,
DestReceiver *self);
/* Per-executor-run initialization and shutdown: */
- void (*startup) (DestReceiver *self, int operation,
- const char *portalName,
- TupleDesc typeinfo,
- List *targetlist);
+ void (*startup) (DestReceiver *self,
+ int operation,
+ TupleDesc typeinfo);
void (*shutdown) (DestReceiver *self);
/* Destroy the receiver object itself (if dynamically allocated) */
void (*destroy) (DestReceiver *self);
@@ -123,10 +120,14 @@ struct _DestReceiver
extern DestReceiver *None_Receiver; /* permanent receiver for None */
+/* 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);
+extern DestReceiver *CreateDestReceiver(CommandDest dest, Portal portal);
extern void EndCommand(const char *commandTag, CommandDest dest);
/* Additional functions that go with destination management, more or less. */
diff --git a/src/include/tcop/pquery.h b/src/include/tcop/pquery.h
index d9d6a6221d5..ff9cc9d76ac 100644
--- a/src/include/tcop/pquery.h
+++ b/src/include/tcop/pquery.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: pquery.h,v 1.26 2003/05/06 20:26:28 tgl Exp $
+ * $Id: pquery.h,v 1.27 2003/05/08 18:16:37 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -20,7 +20,6 @@
extern void ProcessQuery(Query *parsetree,
Plan *plan,
ParamListInfo params,
- const char *portalName,
DestReceiver *dest,
char *completionTag);
@@ -28,6 +27,9 @@ extern PortalStrategy ChoosePortalStrategy(List *parseTrees);
extern void PortalStart(Portal portal, ParamListInfo params);
+extern void PortalSetResultFormat(Portal portal, int nFormats,
+ int16 *formats);
+
extern bool PortalRun(Portal portal, long count,
DestReceiver *dest, DestReceiver *altdest,
char *completionTag);