]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
expandRTE and get_rte_attribute_type mistakenly always imputed typmod -1
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 29 May 2005 17:10:35 +0000 (17:10 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 29 May 2005 17:10:35 +0000 (17:10 +0000)
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.

src/backend/parser/parse_relation.c

index 6360e402f86cce5d97759a00b2fcdc746f7cf1c6..0145f86500cb16a413956ac1c118648d301d65df 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/parser/parse_relation.c,v 1.102 2004/12/31 22:00:27 pgsql Exp $
+ *       $PostgreSQL: pgsql/src/backend/parser/parse_relation.c,v 1.102.4.1 2005/05/29 17:10:35 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -1374,7 +1374,7 @@ expandRTE(List *rtable, int rtindex, int sublevels_up,
                                                        varnode = makeVar(rtindex,
                                                                                          attnum,
                                                                                          atttypid,
-                                                                                         -1,
+                                                                                         colDef->typename->typmod,
                                                                                          sublevels_up);
 
                                                        *colvars = lappend(*colvars, varnode);
@@ -1715,7 +1715,7 @@ get_rte_attribute_type(RangeTblEntry *rte, AttrNumber attnum,
                                        ColumnDef  *colDef = list_nth(coldeflist, attnum - 1);
 
                                        *vartype = typenameTypeId(colDef->typename);
-                                       *vartypmod = -1;
+                                       *vartypmod = colDef->typename->typmod;
                                }
                                else
                                {