diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2006-03-16 00:31:55 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2006-03-16 00:31:55 +0000 |
commit | 23160139617f6cb998604c7324da2175f7409db5 (patch) | |
tree | cdd877b18be4f800499f4240c76aaed7759e0a2f /src/backend/nodes/readfuncs.c | |
parent | 5981b9d03e724a54f3eac706c27056d601954a7f (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/backend/nodes/readfuncs.c')
-rw-r--r-- | src/backend/nodes/readfuncs.c | 45 |
1 files changed, 3 insertions, 42 deletions
diff --git a/src/backend/nodes/readfuncs.c b/src/backend/nodes/readfuncs.c index c7490a9567c..4e762d3a2ec 100644 --- a/src/backend/nodes/readfuncs.c +++ b/src/backend/nodes/readfuncs.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/nodes/readfuncs.c,v 1.186 2006/03/14 22:48:19 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/nodes/readfuncs.c,v 1.187 2006/03/16 00:31:55 tgl Exp $ * * NOTES * Path and Plan nodes do not have any readfuncs support, because we @@ -863,42 +863,6 @@ _readFromExpr(void) * Stuff from parsenodes.h. */ -static ColumnDef * -_readColumnDef(void) -{ - READ_LOCALS(ColumnDef); - - READ_STRING_FIELD(colname); - READ_NODE_FIELD(typename); - READ_INT_FIELD(inhcount); - READ_BOOL_FIELD(is_local); - READ_BOOL_FIELD(is_not_null); - READ_NODE_FIELD(raw_default); - READ_STRING_FIELD(cooked_default); - READ_NODE_FIELD(constraints); - READ_NODE_FIELD(support); - - READ_DONE(); -} - -static TypeName * -_readTypeName(void) -{ - READ_LOCALS(TypeName); - - READ_NODE_FIELD(names); - READ_OID_FIELD(typeid); - READ_BOOL_FIELD(timezone); - READ_BOOL_FIELD(setof); - READ_BOOL_FIELD(pct_type); - READ_INT_FIELD(typmod); - READ_NODE_FIELD(arrayBounds); - /* location is deliberately not stored */ - local_node->location = -1; - - READ_DONE(); -} - /* * _readRangeTblEntry */ @@ -923,7 +887,8 @@ _readRangeTblEntry(void) break; case RTE_FUNCTION: READ_NODE_FIELD(funcexpr); - READ_NODE_FIELD(coldeflist); + READ_NODE_FIELD(funccoltypes); + READ_NODE_FIELD(funccoltypmods); break; case RTE_JOIN: READ_ENUM_FIELD(jointype, JoinType); @@ -1042,10 +1007,6 @@ parseNodeString(void) return_value = _readJoinExpr(); else if (MATCH("FROMEXPR", 8)) return_value = _readFromExpr(); - else if (MATCH("COLUMNDEF", 9)) - return_value = _readColumnDef(); - else if (MATCH("TYPENAME", 8)) - return_value = _readTypeName(); else if (MATCH("RTE", 3)) return_value = _readRangeTblEntry(); else if (MATCH("NOTIFY", 6)) |