diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-09-12 21:16:42 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-09-12 21:16:42 +0000 |
commit | feb202193dd915116748cd6fcb6347f64670002b (patch) | |
tree | 26fe42ffccff6862f677513a18929c24acf6f58b | |
parent | 2b0319869a2230c675752f92bbf2c43e9e5543e3 (diff) | |
download | postgresql-feb202193dd915116748cd6fcb6347f64670002b.tar.gz postgresql-feb202193dd915116748cd6fcb6347f64670002b.zip |
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.
-rw-r--r-- | src/backend/commands/tablecmds.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 7b49ba720aa..380287caa37 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 |