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

Commit 5f6fc34

Browse files
committed
Copy name when cloning FKs recurses to partitions
We were passing a string owned by a syscache entry, which was released before recursing. Fix by pstrdup'ing the string. Per buildfarm member prion.
1 parent f56f8f8 commit 5f6fc34

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/commands/tablecmds.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -8619,7 +8619,7 @@ CloneFkReferencing(List **wqueue, Relation parentRel, Relation partRel)
86198619
"fkey",
86208620
RelationGetNamespace(partRel), NIL);
86218621
else
8622-
fkconstraint->conname = NameStr(constrForm->conname);
8622+
fkconstraint->conname = pstrdup(NameStr(constrForm->conname));
86238623
fkconstraint->fk_upd_action = constrForm->confupdtype;
86248624
fkconstraint->fk_del_action = constrForm->confdeltype;
86258625
fkconstraint->deferrable = constrForm->condeferrable;

0 commit comments

Comments
 (0)