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.
This commit is contained in:
Tom Lane 2002-09-12 21:16:42 +00:00
parent 2b0319869a
commit feb202193d

View File

@ -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,
* 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