Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian2002-04-05 11:58:24 +0000
committerBruce Momjian2002-04-05 11:58:24 +0000
commit80f46fab634f8a307584a6291f7401e6f7e3494d (patch)
tree7cad1a2e409318785380896490bcd9a6c88966f0 /src/backend/commands/rename.c
parent00f4a7d3c33c1a2b1489e3f752a6ed89a3f29251 (diff)
This patch adds a missing heap_freetuple() to renamerel(), documents
the decision not to make renamerel() update the sequence name that is stored within sequences themselves (thanks to Tom Lane), and adds some rudimentary regression tests for ALTER TABLE ... RENAME on non-table relations. Neil Conway
Diffstat (limited to 'src/backend/commands/rename.c')
-rw-r--r--src/backend/commands/rename.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/backend/commands/rename.c b/src/backend/commands/rename.c
index 4f3d300dae3..5760cbe3004 100644
--- a/src/backend/commands/rename.c
+++ b/src/backend/commands/rename.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/Attic/rename.c,v 1.68 2002/03/31 07:49:30 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/Attic/rename.c,v 1.69 2002/04/05 11:58:24 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -248,6 +248,12 @@ renameatt(Oid relid,
/*
* renamerel - change the name of a relation
+ *
+ * XXX - When renaming sequences, we don't bother to modify the
+ * sequence name that is stored within the sequence itself
+ * (this would cause problems with MVCC). In the future,
+ * the sequence name should probably be removed from the
+ * sequence, AFAIK there's no need for it to be there.
*/
void
renamerel(Oid relid, const char *newrelname)
@@ -312,6 +318,7 @@ renamerel(Oid relid, const char *newrelname)
CatalogCloseIndices(Num_pg_class_indices, irelations);
heap_close(relrelation, NoLock);
+ heap_freetuple(reltup);
/*
* Also rename the associated type, if any.