Commit feb20219 authored by Tom Lane's avatar Tom Lane

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.
parent 2b031986
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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, ...@@ -2920,7 +2920,7 @@ createForeignKeyTriggers(Relation rel, FkConstraint *fkconstraint,
* unfortunately). * unfortunately).
*/ */
myRel = makeRangeVar(get_namespace_name(RelationGetNamespace(rel)), myRel = makeRangeVar(get_namespace_name(RelationGetNamespace(rel)),
RelationGetRelationName(rel)); pstrdup(RelationGetRelationName(rel)));
/* /*
* Preset objectAddress fields * Preset objectAddress fields
......
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