diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/catalog/pg_proc.h | 5 | ||||
-rw-r--r-- | src/include/libpq/libpq.h | 192 | ||||
-rw-r--r-- | src/include/tcop/dest.h | 17 | ||||
-rw-r--r-- | src/include/utils/builtins.h | 10 |
4 files changed, 16 insertions, 208 deletions
diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h index cdf2b06ea33..bd260a827b4 100644 --- a/src/include/catalog/pg_proc.h +++ b/src/include/catalog/pg_proc.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: pg_proc.h,v 1.145 2000/07/07 19:24:41 petere Exp $ + * $Id: pg_proc.h,v 1.146 2000/07/08 03:04:21 tgl Exp $ * * NOTES * The script catalog/genbki.sh reads this file and generates .bki @@ -965,9 +965,6 @@ DESCR("distance between"); DATA(insert OID = 729 ( poly_distance PGUID 11 f t t t 2 f 701 "604 604" 100 0 0 100 poly_distance - )); DESCR("distance between"); -DATA(insert OID = 730 ( pqtest PGUID 11 f t f t 1 f 23 "25" 100 0 0 100 pqtest - )); -DESCR(""); - DATA(insert OID = 740 ( text_lt PGUID 12 f t t t 2 f 16 "25 25" 100 0 0 0 text_lt - )); DESCR("less-than"); DATA(insert OID = 741 ( text_le PGUID 12 f t t t 2 f 16 "25 25" 100 0 0 0 text_le - )); diff --git a/src/include/libpq/libpq.h b/src/include/libpq/libpq.h index 78e34f0d4ae..3632012f671 100644 --- a/src/include/libpq/libpq.h +++ b/src/include/libpq/libpq.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: libpq.h,v 1.38 2000/06/06 16:04:32 petere Exp $ + * $Id: libpq.h,v 1.39 2000/07/08 03:04:30 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -15,18 +15,15 @@ #define LIBPQ_H #include <sys/types.h> - #include <netinet/in.h> #include "lib/stringinfo.h" #include "libpq/libpq-be.h" -#include "tcop/dest.h" -#include "utils/exc.h" /* ---------------- * PQArgBlock * Information (pointer to array of this structure) required - * for the PQfn() call. + * for the PQfn() call. (This probably ought to go somewhere else...) * ---------------- */ typedef struct @@ -40,101 +37,6 @@ typedef struct } u; } PQArgBlock; -/* ---------------- - * TypeBlock - * Information about an attribute. - * ---------------- - */ -#define NameLength NAMEDATALEN - -typedef struct TypeBlock -{ - char name[NAMEDATALEN]; /* name of the attribute */ - int typid; /* typid of the type */ - int typlen; /* typlen of the type */ -} TypeBlock; - -/* ---------------- - * TupleBlock - * Data of a tuple. - * ---------------- - */ -#define TupleBlockSize 100 - -typedef struct TupleBlock -{ - char **values[TupleBlockSize]; /* an array of tuples */ - int *lengths[TupleBlockSize]; /* an array of length vec. - * foreach tuple */ - struct TupleBlock *next; /* next tuple block */ - int tuple_index; /* current tuple index */ -} TupleBlock; - -/* ---------------- - * GroupBuffer - * A group of tuples with the same attributes. - * ---------------- - */ -typedef struct GroupBuffer -{ - int no_tuples; /* number of tuples in this group */ - int no_fields; /* number of attributes */ - TypeBlock *types; /* types of the attributes */ - TupleBlock *tuples; /* tuples in this group */ - struct GroupBuffer *next; /* next group */ -} GroupBuffer; - -/* ---------------- - * PortalBuffer - * Data structure of a portal buffer. - * ---------------- - */ -typedef struct PortalBuffer -{ - int rule_p; /* 1 if this is an asynchronized portal. */ - int no_tuples; /* number of tuples in this portal buffer */ - int no_groups; /* number of tuple groups */ - GroupBuffer *groups; /* linked list of tuple groups */ -} PortalBuffer; - -/* ---------------- - * PortalEntry - * an entry in the global portal table - * - * Note: the portalcxt is only meaningful for PQcalls made from - * within a postgres backend. frontend apps should ignore it. - * ---------------- - */ -#define PortalNameLength 32 - -typedef struct PortalEntry -{ - char name[PortalNameLength]; /* name of this portal */ - PortalBuffer *portal; /* tuples contained in this portal */ - Pointer portalcxt; /* memory context (for backend) */ - Pointer result; /* result for PQexec */ -} PortalEntry; - -#define PORTALS_INITIAL_SIZE 32 -#define PORTALS_GROW_BY 32 - -/* in portalbuf.c */ -extern PortalEntry **portals; -extern size_t portals_array_size; - -/* - * Exceptions. - */ - -#define libpq_raise(X, Y) ExcRaise((Exception *)(X), (ExcDetail) (Y),\ - (ExcData)0, (ExcMessage) 0) - -/* in portal.c */ -extern Exception MemoryError, - PortalError, - PostquelError, - ProtocolError; - /* * PQerrormsg[] is used only for error messages generated within backend * libpq, none of which are remarkably long. Note that this length should @@ -151,89 +53,6 @@ extern char PQerrormsg[PQERRORMSG_LENGTH]; /* in libpq/util.c */ */ /* - * prototypes for functions in portal.c - */ -extern void pqdebug(char *target, char *msg); -extern void pqdebug2(char *target, char *msg1, char *msg2); -extern void PQtrace(void); -extern void PQuntrace(void); -extern int PQnportals(int rule_p); -extern void PQpnames(char **pnames, int rule_p); -extern PortalBuffer *PQparray(char *pname); -extern int PQrulep(PortalBuffer *portal); -extern int PQntuples(PortalBuffer *portal); -extern int PQninstances(PortalBuffer *portal); -extern int PQngroups(PortalBuffer *portal); -extern int PQntuplesGroup(PortalBuffer *portal, int group_index); -extern int PQninstancesGroup(PortalBuffer *portal, int group_index); -extern int PQnfieldsGroup(PortalBuffer *portal, int group_index); -extern int PQfnumberGroup(PortalBuffer *portal, int group_index, char *field_name); -extern char *PQfnameGroup(PortalBuffer *portal, int group_index, int field_number); -extern int PQftypeGroup(PortalBuffer *portal, int group_index, - int field_number); -extern int PQfsizeGroup(PortalBuffer *portal, int group_index, - int field_number); -extern GroupBuffer *PQgroup(PortalBuffer *portal, int tuple_index); -extern int PQgetgroup(PortalBuffer *portal, int tuple_index); -extern int PQnfields(PortalBuffer *portal, int tuple_index); -extern int PQfnumber(PortalBuffer *portal, int tuple_index, char *field_name); -extern char *PQfname(PortalBuffer *portal, int tuple_index, int field_number); -extern int PQftype(PortalBuffer *portal, int tuple_index, int field_number); -extern int PQfsize(PortalBuffer *portal, int tuple_index, int field_number); -extern int PQsametype(PortalBuffer *portal, int tuple_index1, int tuple_index2); -extern char *PQgetvalue(PortalBuffer *portal, int tuple_index, int field_number); -extern char *PQgetAttr(PortalBuffer *portal, int tuple_index, int field_number); -extern int PQgetlength(PortalBuffer *portal, int tuple_index, int field_number); -extern void PQclear(char *pname); - -/* - * prototypes for functions in portalbuf.c - */ -extern caddr_t pbuf_alloc(size_t size); -extern void pbuf_free(caddr_t pointer); -extern PortalBuffer *pbuf_addPortal(void); -extern GroupBuffer *pbuf_addGroup(PortalBuffer *portal); -extern TypeBlock *pbuf_addTypes(int n); -extern TupleBlock *pbuf_addTuples(void); -extern char **pbuf_addTuple(int n); -extern int *pbuf_addTupleValueLengths(int n); -extern char *pbuf_addValues(int n); -extern PortalEntry *pbuf_addEntry(void); -extern void pbuf_freeEntry(int i); -extern void pbuf_freeTypes(TypeBlock *types); -extern void pbuf_freeTuples(TupleBlock *tuples, int no_tuples, int no_fields); -extern void pbuf_freeGroup(GroupBuffer *group); -extern void pbuf_freePortal(PortalBuffer *portal); -extern int pbuf_getIndex(char *pname); -extern void pbuf_setportalinfo(PortalEntry *entry, char *pname); -extern PortalEntry *pbuf_setup(char *pname); -extern void pbuf_close(char *pname); -extern GroupBuffer *pbuf_findGroup(PortalBuffer *portal, int group_index); -extern int pbuf_findFnumber(GroupBuffer *group, char *field_name); -extern void pbuf_checkFnumber(GroupBuffer *group, int field_number); -extern char *pbuf_findFname(GroupBuffer *group, int field_number); - -/* in be-dumpdata.c */ -extern void be_portalinit(void); -extern void be_portalpush(PortalEntry *entry); -extern PortalEntry *be_portalpop(void); -extern PortalEntry *be_currentportal(void); -extern PortalEntry *be_newportal(void); -extern void be_typeinit(PortalEntry *entry, TupleDesc attrs, - int natts); -extern void be_printtup(HeapTuple tuple, TupleDesc typeinfo, - DestReceiver *self); - - -/* in be-pqexec.c */ -extern char *PQfn(int fnid, int *result_buf, int result_len, int result_is_int, - PQArgBlock *args, int nargs); -extern char *PQexec(char *query); -extern int pqtest_PQexec(char *q); -extern int pqtest_PQfn(char *q); -extern int32 pqtest(struct varlena * vlena); - -/* * prototypes for functions in pqcomm.c */ extern int StreamServerPort(int family, unsigned short portName, int *fdP); @@ -250,4 +69,11 @@ extern int pq_putmessage(char msgtype, const char *s, size_t len); extern void pq_startcopyout(void); extern void pq_endcopyout(bool errorAbort); +/* + * prototypes for functions in util.c + */ +extern void pqdebug(char *fmt, char *msg); +extern void PQtrace(void); +extern void PQuntrace(void); + #endif /* LIBPQ_H */ diff --git a/src/include/tcop/dest.h b/src/include/tcop/dest.h index e601cb4bc9c..1cff3a78bb1 100644 --- a/src/include/tcop/dest.h +++ b/src/include/tcop/dest.h @@ -2,22 +2,16 @@ * * dest.h * Whenever the backend executes a query, the results - * have to go someplace - either to the standard output, - * to a local portal buffer or to a remote portal buffer. + * have to go someplace. * * - stdout is the destination only when we are running a * backend without a postmaster and are returning results - * back to the user. + * back to an interactive 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 + * - a remote process 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. + * to the frontend via the functions in backend/libpq. * * - None is the destination when the system executes * a query internally. This is not used now but it may be @@ -45,7 +39,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: dest.h,v 1.23 2000/01/26 05:58:35 momjian Exp $ + * $Id: dest.h,v 1.24 2000/07/08 03:04:33 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -63,7 +57,6 @@ 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 */ RemoteInternal, /* results sent to frontend process in * internal (binary) form */ diff --git a/src/include/utils/builtins.h b/src/include/utils/builtins.h index eedc9766302..e2c66f513d5 100644 --- a/src/include/utils/builtins.h +++ b/src/include/utils/builtins.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: builtins.h,v 1.121 2000/07/07 19:24:43 petere Exp $ + * $Id: builtins.h,v 1.122 2000/07/08 03:04:36 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -184,14 +184,6 @@ extern Datum rt_poly_size(PG_FUNCTION_ARGS); extern POLYGON *rt_poly_union(POLYGON *a, POLYGON *b); extern POLYGON *rt_poly_inter(POLYGON *a, POLYGON *b); -/* projection utilities */ -/* extern char *GetAttributeByName(); - extern char *GetAttributeByNum(); , - in executor/executor.h*/ - - -extern int32 pqtest(struct varlena * vlena); - /* arrayfuncs.c */ /* filename.c */ |