summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorTom Lane2006-03-16 00:31:55 +0000
committerTom Lane2006-03-16 00:31:55 +0000
commit23160139617f6cb998604c7324da2175f7409db5 (patch)
treecdd877b18be4f800499f4240c76aaed7759e0a2f /src/include
parent5981b9d03e724a54f3eac706c27056d601954a7f (diff)
Clean up representation of function RTEs for functions returning RECORD.
The original coding stored the raw parser output (ColumnDef and TypeName nodes) which was ugly, bulky, and wrong because it failed to create any dependency on the referenced datatype --- and in fact would not track type renamings and suchlike. Instead store a list of column type OIDs in the RTE. Also fix up general failure of recordDependencyOnExpr to do anything sane about recording dependencies on datatypes. While there are many cases where there will be an indirect dependency (eg if an operator returns a datatype, the dependency on the operator is enough), we do have to record the datatype as a separate dependency in examples like CoerceToDomain. initdb forced because of change of stored rules.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/access/tupdesc.h4
-rw-r--r--src/include/catalog/catversion.h4
-rw-r--r--src/include/nodes/parsenodes.h14
3 files changed, 14 insertions, 8 deletions
diff --git a/src/include/access/tupdesc.h b/src/include/access/tupdesc.h
index 1a5e23e1d1b..670ef5c92e0 100644
--- a/src/include/access/tupdesc.h
+++ b/src/include/access/tupdesc.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/access/tupdesc.h,v 1.48 2006/03/05 15:58:53 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/access/tupdesc.h,v 1.49 2006/03/16 00:31:55 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -92,4 +92,6 @@ extern void TupleDescInitEntry(TupleDesc desc,
extern TupleDesc BuildDescForRelation(List *schema);
+extern TupleDesc BuildDescFromLists(List *names, List *types, List *typmods);
+
#endif /* TUPDESC_H */
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h
index 4b541531f84..2ae52c723fc 100644
--- a/src/include/catalog/catversion.h
+++ b/src/include/catalog/catversion.h
@@ -37,7 +37,7 @@
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.320 2006/03/10 20:15:26 neilc Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.321 2006/03/16 00:31:55 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -53,6 +53,6 @@
*/
/* yyyymmddN */
-#define CATALOG_VERSION_NO 200603101
+#define CATALOG_VERSION_NO 200603151
#endif
diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h
index 0e7d5bf9f51..aea32d236d9 100644
--- a/src/include/nodes/parsenodes.h
+++ b/src/include/nodes/parsenodes.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.304 2006/03/14 22:48:22 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.305 2006/03/16 00:31:55 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -362,8 +362,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 */
+ List *coldeflist; /* list of ColumnDef nodes to describe
+ * result of function returning RECORD */
} RangeFunction;
/*
@@ -547,10 +547,14 @@ typedef struct RangeTblEntry
/*
* Fields valid for a function RTE (else NULL):
+ *
+ * If the function returns RECORD, funccoltypes lists the column types
+ * declared in the RTE's column type specification, and funccoltypmods
+ * lists their declared typmods. Otherwise, both fields are NIL.
*/
Node *funcexpr; /* expression tree for func call */
- List *coldeflist; /* list of ColumnDef nodes for runtime
- * assignment of RECORD TupleDesc */
+ List *funccoltypes; /* OID list of column type OIDs */
+ List *funccoltypmods; /* integer list of column typmods */
/*
* Fields valid for a join RTE (else NULL/zero):