diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/catalog/catversion.h | 4 | ||||
-rw-r--r-- | src/include/executor/functions.h | 6 | ||||
-rw-r--r-- | src/include/nodes/makefuncs.h | 8 | ||||
-rw-r--r-- | src/include/nodes/nodes.h | 4 | ||||
-rw-r--r-- | src/include/nodes/primnodes.h | 48 | ||||
-rw-r--r-- | src/include/parser/parse_func.h | 4 | ||||
-rw-r--r-- | src/include/utils/fcache.h | 7 |
7 files changed, 43 insertions, 38 deletions
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h index d0c0b8e2bf9..e69b5753e3a 100644 --- a/src/include/catalog/catversion.h +++ b/src/include/catalog/catversion.h @@ -37,7 +37,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: catversion.h,v 1.40 2000/08/06 18:06:13 thomas Exp $ + * $Id: catversion.h,v 1.41 2000/08/08 15:42:33 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -53,6 +53,6 @@ */ /* yyyymmddN */ -#define CATALOG_VERSION_NO 200008061 +#define CATALOG_VERSION_NO 200008071 #endif diff --git a/src/include/executor/functions.h b/src/include/executor/functions.h index 26f2daac535..0e55be1980e 100644 --- a/src/include/executor/functions.h +++ b/src/include/executor/functions.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: functions.h,v 1.12 2000/05/28 17:56:18 tgl Exp $ + * $Id: functions.h,v 1.13 2000/08/08 15:42:39 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -17,12 +17,8 @@ #include "nodes/parsenodes.h" #include "utils/syscache.h" -extern Datum ProjectAttribute(TupleDesc TD, TargetEntry *tlist, - HeapTuple tup, bool *isnullP); - extern Datum postquel_function(FunctionCallInfo fcinfo, FunctionCachePtr fcache, - List *func_tlist, bool *isDone); #endif /* FUNCTIONS_H */ diff --git a/src/include/nodes/makefuncs.h b/src/include/nodes/makefuncs.h index 3b470b150a2..1ec37fc7b6f 100644 --- a/src/include/nodes/makefuncs.h +++ b/src/include/nodes/makefuncs.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: makefuncs.h,v 1.24 2000/04/12 17:16:40 momjian Exp $ + * $Id: makefuncs.h,v 1.25 2000/08/08 15:42:59 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -18,9 +18,7 @@ extern Oper *makeOper(Oid opno, Oid opid, - Oid opresulttype, - int opsize, - FunctionCachePtr op_fcache); + Oid opresulttype); extern Var *makeVar(Index varno, AttrNumber varattno, @@ -34,8 +32,6 @@ extern Resdom *makeResdom(AttrNumber resno, Oid restype, int32 restypmod, char *resname, - Index reskey, - Oid reskeyop, bool resjunk); extern Const *makeConst(Oid consttype, diff --git a/src/include/nodes/nodes.h b/src/include/nodes/nodes.h index 08a44675fc8..27de4d54ebf 100644 --- a/src/include/nodes/nodes.h +++ b/src/include/nodes/nodes.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: nodes.h,v 1.72 2000/07/22 04:22:47 tgl Exp $ + * $Id: nodes.h,v 1.73 2000/08/08 15:42:59 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -64,7 +64,7 @@ typedef enum NodeTag T_Aggref, T_SubLink, T_Func, - T_ArrayXXX, /* not used anymore; this tag# is available */ + T_FieldSelect, T_ArrayRef, T_Iter, T_RelabelType, diff --git a/src/include/nodes/primnodes.h b/src/include/nodes/primnodes.h index 47de5779ae5..1ad9a3d082a 100644 --- a/src/include/nodes/primnodes.h +++ b/src/include/nodes/primnodes.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: primnodes.h,v 1.45 2000/07/22 04:22:47 tgl Exp $ + * $Id: primnodes.h,v 1.46 2000/08/08 15:42:59 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -160,10 +160,9 @@ typedef struct Var /* ---------------- * Oper * opno - PG_OPERATOR OID of the operator - * opid - PG_PROC OID for the operator + * opid - PG_PROC OID for the operator's underlying function * opresulttype - PG_TYPE OID of the operator's return value - * opsize - size of return result (cached by executor) - * op_fcache - XXX comment me. + * op_fcache - runtime state while running the function * * ---- * NOTE: in the good old days 'opno' used to be both (or either, or @@ -175,6 +174,10 @@ typedef struct Var * (i.e. a mess) some comments were referring to 'opno' using the name * 'opid'. Anyway, now we have two separate fields, and of course that * immediately removes all bugs from the code... [ sp :-) ]. + * + * Note also that opid is not necessarily filled in immediately on creation + * of the node. The planner makes sure it is valid before passing the node + * tree to the executor, but during parsing/planning opid is typically 0. * ---------------- */ typedef struct Oper @@ -183,7 +186,6 @@ typedef struct Oper Oid opno; Oid opid; Oid opresulttype; - int opsize; FunctionCachePtr op_fcache; } Oper; @@ -240,7 +242,6 @@ typedef struct Const * paramid - numeric identifier for literal-constant parameters ("$1") * paramname - attribute name for tuple-substitution parameters ("$.foo") * paramtype - PG_TYPE OID of the parameter's value - * param_tlist - allows for projection in a param node. * ---------------- */ typedef struct Param @@ -250,23 +251,17 @@ typedef struct Param AttrNumber paramid; char *paramname; Oid paramtype; - List *param_tlist; } Param; /* ---------------- * Func - * funcid - PG_FUNCTION OID of the function + * funcid - PG_PROC OID of the function * functype - PG_TYPE OID of the function's return value - * funcisindex - the function can be evaluated by scanning an index - * (set during query optimization) - * funcsize - size of return result (cached by executor) * func_fcache - runtime state while running this function. Where * we are in the execution of the function if it * returns more than one value, etc. * See utils/fcache.h - * func_tlist - projection of functions returning tuples - * func_planlist - result of planning this func, if it's a PQ func * ---------------- */ typedef struct Func @@ -274,11 +269,7 @@ typedef struct Func NodeTag type; Oid funcid; Oid functype; - bool funcisindex; - int funcsize; FunctionCachePtr func_fcache; - List *func_tlist; - List *func_planlist; } Func; /* ---------------- @@ -440,6 +431,29 @@ typedef struct ArrayRef } ArrayRef; /* ---------------- + * FieldSelect + * arg - input expression + * fieldnum - attribute number of field to extract + * resulttype - type of the field (result type of this node) + * resulttypmod - output typmod (usually -1) + * + * FieldSelect represents the operation of extracting one field from a tuple + * value. At runtime, the input expression is expected to yield a Datum + * that contains a pointer-to-TupleTableSlot. The specified field number + * is extracted and returned as a Datum. + * ---------------- + */ + +typedef struct FieldSelect +{ + NodeTag type; + Node *arg; + AttrNumber fieldnum; + Oid resulttype; + int32 resulttypmod; +} FieldSelect; + +/* ---------------- * RelabelType * arg - input expression * resulttype - output type of coercion expression diff --git a/src/include/parser/parse_func.h b/src/include/parser/parse_func.h index 836626486b7..79b193a2b51 100644 --- a/src/include/parser/parse_func.h +++ b/src/include/parser/parse_func.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: parse_func.h,v 1.24 2000/04/12 17:16:45 momjian Exp $ + * $Id: parse_func.h,v 1.25 2000/08/08 15:42:59 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -45,8 +45,6 @@ extern Node *ParseFuncOrColumn(ParseState *pstate, bool agg_star, bool agg_distinct, int *curr_resno, int precedence); -extern List *setup_base_tlist(Oid typeid); - extern bool typeInheritsFrom(Oid subclassTypeId, Oid superclassTypeId); extern void func_error(char *caller, char *funcname, diff --git a/src/include/utils/fcache.h b/src/include/utils/fcache.h index 59f35867a72..efae7613959 100644 --- a/src/include/utils/fcache.h +++ b/src/include/utils/fcache.h @@ -11,7 +11,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: fcache.h,v 1.12 2000/07/12 02:37:35 tgl Exp $ + * $Id: fcache.h,v 1.13 2000/08/08 15:43:12 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -29,8 +29,9 @@ typedef struct int typlen; /* length of the return type */ bool typbyval; /* true if return type is pass by value */ - bool oneResult; /* true we only want 1 result from the - * function */ + bool returnsTuple; /* true if return type is a tuple */ + bool returnsSet; /* true if func returns a set (multi rows) */ + bool hasSetArg; /* true if func is part of a nested dot * expr whose argument is func returning a * set ugh! */ |