Skip to content

Commit feb2021

Browse files
committed
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.
1 parent 2b03198 commit feb2021

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/commands/tablecmds.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/commands/tablecmds.c,v 1.40 2002/09/06 00:01:53 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/commands/tablecmds.c,v 1.41 2002/09/12 21:16:42 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -2920,7 +2920,7 @@ createForeignKeyTriggers(Relation rel, FkConstraint *fkconstraint,
29202920
* unfortunately).
29212921
*/
29222922
myRel = makeRangeVar(get_namespace_name(RelationGetNamespace(rel)),
2923-
RelationGetRelationName(rel));
2923+
pstrdup(RelationGetRelationName(rel)));
29242924

29252925
/*
29262926
* Preset objectAddress fields

0 commit comments

Comments
 (0)