Commit bbc04831 authored by Tom Lane's avatar Tom Lane

expandRTE and get_rte_attribute_type mistakenly always imputed typmod -1

to columns of an RTE that was a function returning RECORD with a column
definition list.  Apparently no one has tried to use non-default typmod
with a function returning RECORD before.
parent e92a8827
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/parser/parse_relation.c,v 1.107 2005/04/28 21:47:14 tgl Exp $ * $PostgreSQL: pgsql/src/backend/parser/parse_relation.c,v 1.108 2005/05/29 17:10:23 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -1333,7 +1333,7 @@ expandRTE(List *rtable, int rtindex, int sublevels_up, ...@@ -1333,7 +1333,7 @@ expandRTE(List *rtable, int rtindex, int sublevels_up,
varnode = makeVar(rtindex, varnode = makeVar(rtindex,
attnum, attnum,
atttypid, atttypid,
-1, colDef->typename->typmod,
sublevels_up); sublevels_up);
*colvars = lappend(*colvars, varnode); *colvars = lappend(*colvars, varnode);
...@@ -1678,7 +1678,7 @@ get_rte_attribute_type(RangeTblEntry *rte, AttrNumber attnum, ...@@ -1678,7 +1678,7 @@ get_rte_attribute_type(RangeTblEntry *rte, AttrNumber attnum,
ColumnDef *colDef = list_nth(rte->coldeflist, attnum - 1); ColumnDef *colDef = list_nth(rte->coldeflist, attnum - 1);
*vartype = typenameTypeId(colDef->typename); *vartype = typenameTypeId(colDef->typename);
*vartypmod = -1; *vartypmod = colDef->typename->typmod;
} }
else else
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment