summaryrefslogtreecommitdiff
path: root/src/include/tcop
diff options
context:
space:
mode:
authorMarc G. Fournier1996-08-28 07:27:54 +0000
committerMarc G. Fournier1996-08-28 07:27:54 +0000
commit870be9fa8e5ead7a9fec1b1cf539c701bba57d2a (patch)
tree0980ed1b45ec7974d2ceea9df3d0570c165804b6 /src/include/tcop
parent907c884fe8b88d3df5883c278cacb094a1cfc7ac (diff)
Clean up th ecompile process by centralizing the include files
- code compile tested, but due to a yet unresolved problem with parse.h's creation, compile not completed...
Diffstat (limited to 'src/include/tcop')
-rw-r--r--src/include/tcop/dest.h78
-rw-r--r--src/include/tcop/fastpath.h31
-rw-r--r--src/include/tcop/pquery.h36
-rw-r--r--src/include/tcop/tcopdebug.h43
-rw-r--r--src/include/tcop/tcopprot.h40
-rw-r--r--src/include/tcop/utility.h18
6 files changed, 246 insertions, 0 deletions
diff --git a/src/include/tcop/dest.h b/src/include/tcop/dest.h
new file mode 100644
index 0000000000..9acdff5670
--- /dev/null
+++ b/src/include/tcop/dest.h
@@ -0,0 +1,78 @@
+/*-------------------------------------------------------------------------
+ *
+ * dest.h--
+ * Whenever the backend is submitted a query, the results
+ * have to go someplace - either to the standard output,
+ * to a local portal buffer or to a remote portal buffer.
+ *
+ * - stdout is the destination only when we are running a
+ * backend without a postmaster and are returning results
+ * back to the user.
+ *
+ * - a local portal buffer is the destination when a backend
+ * executes a user-defined function which calls PQexec() or
+ * PQfn(). In this case, the results are collected into a
+ * PortalBuffer which the user's function may diddle with.
+ *
+ * - a remote portal buffer is the destination when we are
+ * running a backend with a frontend and the frontend executes
+ * PQexec() or PQfn(). In this case, the results are sent
+ * to the frontend via the pq_ functions.
+ *
+ * - None is the destination when the system executes
+ * a query internally. This is not used now but it may be
+ * useful for the parallel optimiser/executor.
+ *
+ *
+ * Copyright (c) 1994, Regents of the University of California
+ *
+ * $Id: dest.h,v 1.1 1996/08/28 07:27:49 scrappy Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef DEST_H
+#define DEST_H
+
+#include "catalog/pg_attribute.h"
+#include "access/tupdesc.h"
+
+/* ----------------
+ * CommandDest is used to allow the results of calling
+ * pg_eval() to go to the right place.
+ * ----------------
+ */
+typedef enum {
+ None, /* results are discarded */
+ Debug, /* results go to debugging output */
+ Local, /* results go in local portal buffer */
+ Remote, /* results sent to frontend process */
+ CopyBegin, /* results sent to frontend process but are strings */
+ CopyEnd, /* results sent to frontend process but are strings */
+ RemoteInternal /* results sent to frontend process in internal
+ (binary) form */
+} CommandDest;
+
+
+/* AttrInfo* replaced with TupleDesc, now that TupleDesc also has within it
+ the number of attributes
+
+typedef struct AttrInfo {
+ int numAttr;
+ AttributeTupleForm *attrs;
+} AttrInfo;
+*/
+
+extern void donothing(List *tuple, List *attrdesc);
+extern void (*DestToFunction(CommandDest dest))();
+extern void EndCommand(char *commandTag, CommandDest dest);
+extern void SendCopyBegin();
+extern void ReceiveCopyBegin();
+extern void NullCommand(CommandDest dest);
+extern void BeginCommand(char *pname, int operation, TupleDesc attinfo,
+ bool isIntoRel, bool isIntoPortal, char *tag,
+ CommandDest dest);
+extern void ResetAppendOid();
+extern void UpdateAppendOid(Oid newoid);
+extern Oid GetAppendOid();
+
+#endif /* DEST_H */
diff --git a/src/include/tcop/fastpath.h b/src/include/tcop/fastpath.h
new file mode 100644
index 0000000000..a46d6f2d6f
--- /dev/null
+++ b/src/include/tcop/fastpath.h
@@ -0,0 +1,31 @@
+/*-------------------------------------------------------------------------
+ *
+ * fastpath.h--
+ *
+ *
+ *
+ * Copyright (c) 1994, Regents of the University of California
+ *
+ * $Id: fastpath.h,v 1.1 1996/08/28 07:27:50 scrappy Exp $
+ *
+ * NOTES
+ * This information pulled out of tcop/fastpath.c and put
+ * here so that the PQfn() in be-pqexec.c could access it.
+ * -cim 2/26/91
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef FASTPATH_H
+#define FASTPATH_H
+
+/* ----------------
+ * fastpath #defines
+ * ----------------
+ */
+#define VAR_LENGTH_RESULT (-1)
+#define VAR_LENGTH_ARG (-5)
+#define MAX_STRING_LENGTH 256
+
+extern int HandleFunctionRequest(void);
+
+#endif /* FASTPATH_H */
diff --git a/src/include/tcop/pquery.h b/src/include/tcop/pquery.h
new file mode 100644
index 0000000000..d8cbc7a49e
--- /dev/null
+++ b/src/include/tcop/pquery.h
@@ -0,0 +1,36 @@
+/*-------------------------------------------------------------------------
+ *
+ * pquery.h--
+ * prototypes for pquery.c.
+ *
+ *
+ * Copyright (c) 1994, Regents of the University of California
+ *
+ * $Id: pquery.h,v 1.1 1996/08/28 07:27:51 scrappy Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef PQUERY_H
+#define PQUERY_H
+
+#include "executor/execdesc.h"
+#include "tcop/dest.h"
+
+/* moved to execdesc.h
+extern QueryDesc *CreateQueryDesc(Query *parsetree, Plan *plantree,
+ CommandDest dest);
+
+*/
+extern EState *CreateExecutorState();
+
+
+extern void ProcessPortal(char *portalName, Query *parseTree,
+ Plan *plan, EState *state, TupleDesc attinfo,
+ CommandDest dest);
+
+extern void ProcessQueryDesc(QueryDesc *queryDesc);
+
+extern void ProcessQuery(Query *parsetree, Plan *plan, char *argv[],
+ Oid *typev, int nargs, CommandDest dest);
+
+#endif /* pqueryIncluded */
diff --git a/src/include/tcop/tcopdebug.h b/src/include/tcop/tcopdebug.h
new file mode 100644
index 0000000000..ecec82c652
--- /dev/null
+++ b/src/include/tcop/tcopdebug.h
@@ -0,0 +1,43 @@
+/*-------------------------------------------------------------------------
+ *
+ * tcopdebug.h--
+ * #defines governing debugging behaviour in the traffic cop
+ *
+ *
+ * Copyright (c) 1994, Regents of the University of California
+ *
+ * $Id: tcopdebug.h,v 1.1 1996/08/28 07:27:52 scrappy Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef TCOPDEBUG_H
+#define TCOPDEBUG_H
+
+/* ----------------------------------------------------------------
+ * debugging defines.
+ *
+ * If you want certain debugging behaviour, then #define
+ * the variable to 1, else #undef it. -cim 10/26/89
+ * ----------------------------------------------------------------
+ */
+
+/* ----------------
+ * TCOP_SHOWSTATS controls whether or not buffer and
+ * access method statistics are shown for each query. -cim 2/9/89
+ * ----------------
+ */
+#undef TCOP_SHOWSTATS
+
+/* ----------------
+ * TCOP_DONTUSENEWLINE controls the default setting of
+ * the UseNewLine variable in postgres.c
+ * ----------------
+ */
+#undef TCOP_DONTUSENEWLINE
+
+/* ----------------------------------------------------------------
+ * #defines controlled by above definitions
+ * ----------------------------------------------------------------
+ */
+
+#endif /* TCOPDEBUG_H */
diff --git a/src/include/tcop/tcopprot.h b/src/include/tcop/tcopprot.h
new file mode 100644
index 0000000000..7d751051df
--- /dev/null
+++ b/src/include/tcop/tcopprot.h
@@ -0,0 +1,40 @@
+/*-------------------------------------------------------------------------
+ *
+ * tcopprot.h--
+ * prototypes for postgres.c.
+ *
+ *
+ * Copyright (c) 1994, Regents of the University of California
+ *
+ * $Id: tcopprot.h,v 1.1 1996/08/28 07:27:53 scrappy Exp $
+ *
+ * OLD COMMENTS
+ * This file was created so that other c files could get the two
+ * function prototypes without having to include tcop.h which single
+ * handedly includes the whole f*cking tree -- mer 5 Nov. 1991
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef TCOPPROT_H
+#define TCOPPROT_H
+
+#include "tcop/dest.h"
+#include "nodes/pg_list.h"
+#include "parser/parse_query.h"
+
+#ifndef BOOTSTRAP_INCLUDE
+extern List *pg_plan(char *query_string, Oid *typev, int nargs,
+ QueryTreeList **queryListP, CommandDest dest);
+extern void pg_eval(char *query_string, char **argv, Oid *typev, int nargs);
+extern void pg_eval_dest(char *query_string, char **argv, Oid *typev,
+ int nargs, CommandDest dest);
+#endif /* BOOTSTRAP_HEADER */
+
+extern void handle_warn();
+extern void quickdie();
+extern void die();
+extern int PostgresMain(int argc, char *argv[]);
+extern void ResetUsage();
+extern void ShowUsage();
+
+#endif /* tcopprotIncluded */
diff --git a/src/include/tcop/utility.h b/src/include/tcop/utility.h
new file mode 100644
index 0000000000..ae7c085fb5
--- /dev/null
+++ b/src/include/tcop/utility.h
@@ -0,0 +1,18 @@
+/*-------------------------------------------------------------------------
+ *
+ * utility.h--
+ * prototypes for utility.c.
+ *
+ *
+ * Copyright (c) 1994, Regents of the University of California
+ *
+ * $Id: utility.h,v 1.1 1996/08/28 07:27:54 scrappy Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef UTILITY_H
+#define UTILITY_H
+
+extern void ProcessUtility(Node *parsetree, CommandDest dest);
+
+#endif /* UTILITY_H */