aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/catalog/catversion.h4
-rw-r--r--src/include/catalog/pg_type.h20
-rw-r--r--src/include/nodes/execnodes.h18
-rw-r--r--src/include/nodes/parsenodes.h6
-rw-r--r--src/include/parser/parse_relation.h5
5 files changed, 38 insertions, 15 deletions
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h
index f3e36226b01..12669ed78dd 100644
--- a/src/include/catalog/catversion.h
+++ b/src/include/catalog/catversion.h
@@ -37,7 +37,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: catversion.h,v 1.144 2002/08/02 18:15:09 tgl Exp $
+ * $Id: catversion.h,v 1.145 2002/08/04 19:48:10 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -53,6 +53,6 @@
*/
/* yyyymmddN */
-#define CATALOG_VERSION_NO 200208011
+#define CATALOG_VERSION_NO 200208041
#endif
diff --git a/src/include/catalog/pg_type.h b/src/include/catalog/pg_type.h
index 1f801611a05..6bc4a2a92ae 100644
--- a/src/include/catalog/pg_type.h
+++ b/src/include/catalog/pg_type.h
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: pg_type.h,v 1.125 2002/07/24 19:11:13 petere Exp $
+ * $Id: pg_type.h,v 1.126 2002/08/04 19:48:10 momjian Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
@@ -60,10 +60,10 @@ CATALOG(pg_type) BOOTSTRAP
bool typbyval;
/*
- * typtype is 'b' for a basic type and 'c' for a catalog type (ie a
- * class). If typtype is 'c', typrelid is the OID of the class' entry
- * in pg_class. (Why do we need an entry in pg_type for classes,
- * anyway?)
+ * typtype is 'b' for a basic type, 'c' for a catalog type (ie a
+ * class), or 'p' for a pseudo type. If typtype is 'c', typrelid is the
+ * OID of the class' entry in pg_class. (Why do we need an entry in
+ * pg_type for classes, anyway?)
*/
char typtype;
@@ -501,6 +501,16 @@ DATA(insert OID = 2209 ( _regoperator PGNSP PGUID -1 f b t \054 0 2204 array_in
DATA(insert OID = 2210 ( _regclass PGNSP PGUID -1 f b t \054 0 2205 array_in array_out i x f 0 -1 0 _null_ _null_ ));
DATA(insert OID = 2211 ( _regtype PGNSP PGUID -1 f b t \054 0 2206 array_in array_out i x f 0 -1 0 _null_ _null_ ));
+/*
+ * pseudo-types
+ *
+ * types with typtype='p' are special types that represent classes of types
+ * that are not easily defined in advance. Currently there is only one pseudo
+ * type -- record. The record type is used to specify that the value is a
+ * tuple, but of unknown structure until runtime.
+ */
+DATA(insert OID = 2249 ( record PGNSP PGUID 4 t p t \054 0 0 oidin oidout i p f 0 -1 0 _null_ _null_ ));
+#define RECORDOID 2249
/*
* prototypes for functions in pg_type.c
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h
index 2dea171e255..ee25cc62c95 100644
--- a/src/include/nodes/execnodes.h
+++ b/src/include/nodes/execnodes.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: execnodes.h,v 1.70 2002/06/20 20:29:49 momjian Exp $
+ * $Id: execnodes.h,v 1.71 2002/08/04 19:48:10 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -509,11 +509,17 @@ typedef struct SubqueryScanState
* Function nodes are used to scan the results of a
* function appearing in FROM (typically a function returning set).
*
- * functionmode function operating mode:
+ * functionmode function operating mode:
* - repeated call
* - materialize
* - return query
+ * tupdesc function's return tuple description
* tuplestorestate private state of tuplestore.c
+ * funcexpr function expression being evaluated
+ * returnsTuple does function return tuples?
+ * fn_typeid OID of function return type
+ * fn_typtype return Datum type, i.e. 'b'ase,
+ * 'c'atalog, or 'p'seudo
* ----------------
*/
typedef enum FunctionMode
@@ -525,12 +531,14 @@ typedef enum FunctionMode
typedef struct FunctionScanState
{
- CommonScanState csstate; /* its first field is NodeTag */
+ CommonScanState csstate; /* its first field is NodeTag */
FunctionMode functionmode;
TupleDesc tupdesc;
void *tuplestorestate;
- Node *funcexpr; /* function expression being evaluated */
- bool returnsTuple; /* does function return tuples? */
+ Node *funcexpr;
+ bool returnsTuple;
+ Oid fn_typeid;
+ char fn_typtype;
} FunctionScanState;
/* ----------------------------------------------------------------
diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h
index 07e985b377b..765d1ca0514 100644
--- a/src/include/nodes/parsenodes.h
+++ b/src/include/nodes/parsenodes.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: parsenodes.h,v 1.197 2002/08/04 04:31:44 momjian Exp $
+ * $Id: parsenodes.h,v 1.198 2002/08/04 19:48:10 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -400,6 +400,8 @@ typedef struct RangeFunction
NodeTag type;
Node *funccallnode; /* untransformed function call tree */
Alias *alias; /* table alias & optional column aliases */
+ List *coldeflist; /* list of ColumnDef nodes for runtime
+ * assignment of RECORD TupleDesc */
} RangeFunction;
/*
@@ -527,6 +529,8 @@ typedef struct RangeTblEntry
* Fields valid for a function RTE (else NULL):
*/
Node *funcexpr; /* expression tree for func call */
+ List *coldeflist; /* list of ColumnDef nodes for runtime
+ * assignment of RECORD TupleDesc */
/*
* Fields valid for a join RTE (else NULL/zero):
diff --git a/src/include/parser/parse_relation.h b/src/include/parser/parse_relation.h
index a34e2a5619f..7abfd047865 100644
--- a/src/include/parser/parse_relation.h
+++ b/src/include/parser/parse_relation.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: parse_relation.h,v 1.35 2002/08/02 18:15:09 tgl Exp $
+ * $Id: parse_relation.h,v 1.36 2002/08/04 19:48:11 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -44,7 +44,7 @@ extern RangeTblEntry *addRangeTableEntryForSubquery(ParseState *pstate,
extern RangeTblEntry *addRangeTableEntryForFunction(ParseState *pstate,
char *funcname,
Node *funcexpr,
- Alias *alias,
+ RangeFunction *rangefunc,
bool inFromCl);
extern RangeTblEntry *addRangeTableEntryForJoin(ParseState *pstate,
List *colnames,
@@ -61,5 +61,6 @@ extern List *expandRelAttrs(ParseState *pstate, RangeTblEntry *rte);
extern int attnameAttNum(Relation rd, const char *attname, bool sysColOK);
extern Name attnumAttName(Relation rd, int attid);
extern Oid attnumTypeId(Relation rd, int attid);
+extern char typeid_get_typtype(Oid typeid);
#endif /* PARSE_RELATION_H */