aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/rename.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/commands/rename.c')
-rw-r--r--src/backend/commands/rename.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/backend/commands/rename.c b/src/backend/commands/rename.c
index 288c9404c12..cf2c1a1bd00 100644
--- a/src/backend/commands/rename.c
+++ b/src/backend/commands/rename.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/Attic/rename.c,v 1.36 1999/11/24 00:44:30 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/Attic/rename.c,v 1.37 1999/11/25 00:15:57 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -56,7 +56,6 @@ renameatt(char *relname,
HeapTuple reltup,
oldatttup,
newatttup;
- Relation irelations[Num_pg_attr_indices];
Oid relid;
/*
@@ -159,10 +158,13 @@ renameatt(char *relname,
heap_update(attrelation, &oldatttup->t_self, oldatttup, NULL);
/* keep system catalog indices current */
- CatalogOpenIndices(Num_pg_attr_indices, Name_pg_attr_indices, irelations);
- CatalogIndexInsert(irelations, Num_pg_attr_indices, attrelation, oldatttup);
- CatalogCloseIndices(Num_pg_attr_indices, irelations);
-
+ {
+ Relation irelations[Num_pg_attr_indices];
+ CatalogOpenIndices(Num_pg_attr_indices, Name_pg_attr_indices, irelations);
+ CatalogIndexInsert(irelations, Num_pg_attr_indices, attrelation, oldatttup);
+ CatalogCloseIndices(Num_pg_attr_indices, irelations);
+ }
+
pfree(oldatttup);
heap_close(attrelation, RowExclusiveLock);
}