From: Tom Lane Date: Thu, 12 Sep 2002 21:16:42 +0000 (+0000) Subject: Fix likely cause of rare ALTER TABLE ADD FOREIGN KEY failures --- X-Git-Tag: REL7_3~493 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=feb202193dd915116748cd6fcb6347f64670002b;p=postgresql Fix likely cause of rare ALTER TABLE ADD FOREIGN KEY failures --- don't assume relname field of a relcache entry will stay valid across lots of operations. --- diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 7b49ba720a..380287caa3 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/tablecmds.c,v 1.40 2002/09/06 00:01:53 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/tablecmds.c,v 1.41 2002/09/12 21:16:42 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -2920,7 +2920,7 @@ createForeignKeyTriggers(Relation rel, FkConstraint *fkconstraint, * unfortunately). */ myRel = makeRangeVar(get_namespace_name(RelationGetNamespace(rel)), - RelationGetRelationName(rel)); + pstrdup(RelationGetRelationName(rel))); /* * Preset objectAddress fields