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
1 changed files with 2 additions and 2 deletions

View File

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