Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 47c5b8f

Browse files
committed
Fix unwarranted assumption that a cached rowtype would stick around
for the lifespan of the CreateStmt. Per buildfarm member jaguar.
1 parent 45c88a5 commit 47c5b8f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/backend/parser/parse_utilcmd.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
2020
* Portions Copyright (c) 1994, Regents of the University of California
2121
*
22-
* $PostgreSQL: pgsql/src/backend/parser/parse_utilcmd.c,v 2.37 2010/01/28 23:21:12 petere Exp $
22+
* $PostgreSQL: pgsql/src/backend/parser/parse_utilcmd.c,v 2.38 2010/02/03 05:46:37 tgl Exp $
2323
*
2424
*-------------------------------------------------------------------------
2525
*/
@@ -822,10 +822,10 @@ transformOfType(ParseState *pstate, CreateStmtContext *cxt, TypeName *ofTypename
822822
tupdesc = lookup_rowtype_tupdesc(ofTypeId, -1);
823823
for (i = 0; i < tupdesc->natts; i++)
824824
{
825-
ColumnDef *n = makeNode(ColumnDef);
826825
Form_pg_attribute attr = tupdesc->attrs[i];
826+
ColumnDef *n = makeNode(ColumnDef);
827827

828-
n->colname = NameStr(attr->attname);
828+
n->colname = pstrdup(NameStr(attr->attname));
829829
n->typeName = makeTypeNameFromOid(attr->atttypid, attr->atttypmod);
830830
n->constraints = NULL;
831831
n->is_local = true;

0 commit comments

Comments
 (0)