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

Lines changed: 3 additions & 3 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy