Commit 5f6fc34a authored by Alvaro Herrera's avatar Alvaro Herrera

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.
parent f56f8f8d
......@@ -8619,7 +8619,7 @@ CloneFkReferencing(List **wqueue, Relation parentRel, Relation partRel)
"fkey",
RelationGetNamespace(partRel), NIL);
else
fkconstraint->conname = NameStr(constrForm->conname);
fkconstraint->conname = pstrdup(NameStr(constrForm->conname));
fkconstraint->fk_upd_action = constrForm->confupdtype;
fkconstraint->fk_del_action = constrForm->confdeltype;
fkconstraint->deferrable = constrForm->condeferrable;
......
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