diff options
Diffstat (limited to 'src/backend/commands/dbcommands.c')
-rw-r--r-- | src/backend/commands/dbcommands.c | 32 |
1 files changed, 5 insertions, 27 deletions
diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c index 2c401a6dbdc..d043d95b784 100644 --- a/src/backend/commands/dbcommands.c +++ b/src/backend/commands/dbcommands.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.97 2002/07/20 05:16:57 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.98 2002/08/05 03:29:16 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -347,19 +347,8 @@ createdb(const CreatedbStmt *stmt) simple_heap_insert(pg_database_rel, tuple); - /* - * Update indexes - */ - if (RelationGetForm(pg_database_rel)->relhasindex) - { - Relation idescs[Num_pg_database_indices]; - - CatalogOpenIndices(Num_pg_database_indices, - Name_pg_database_indices, idescs); - CatalogIndexInsert(idescs, Num_pg_database_indices, pg_database_rel, - tuple); - CatalogCloseIndices(Num_pg_database_indices, idescs); - } + /* Update indexes */ + CatalogUpdateIndexes(pg_database_rel, tuple); /* Close pg_database, but keep lock till commit */ heap_close(pg_database_rel, NoLock); @@ -562,19 +551,8 @@ AlterDatabaseSet(AlterDatabaseSetStmt *stmt) newtuple = heap_modifytuple(tuple, rel, repl_val, repl_null, repl_repl); simple_heap_update(rel, &tuple->t_self, newtuple); - /* - * Update indexes - */ - if (RelationGetForm(rel)->relhasindex) - { - Relation idescs[Num_pg_database_indices]; - - CatalogOpenIndices(Num_pg_database_indices, - Name_pg_database_indices, idescs); - CatalogIndexInsert(idescs, Num_pg_database_indices, rel, - newtuple); - CatalogCloseIndices(Num_pg_database_indices, idescs); - } + /* Update indexes */ + CatalogUpdateIndexes(rel, newtuple); heap_endscan(scan); heap_close(rel, RowExclusiveLock); |