From 15fe086fba52bbac7560151e06d1efb3daa69e4a Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 5 Aug 2002 03:29:17 +0000 Subject: Restructure system-catalog index updating logic. Instead of having hardwired lists of index names for each catalog, use the relcache's mechanism for caching lists of OIDs of indexes of any table. This reduces the common case of updating system catalog indexes to a single line, makes it much easier to add a new system index (in fact, you can now do so on-the-fly if you want to), and as a nice side benefit improves performance a little. Per recent pghackers discussion. --- src/backend/commands/proclang.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'src/backend/commands/proclang.c') diff --git a/src/backend/commands/proclang.c b/src/backend/commands/proclang.c index 567b59dae80..0c28dea7317 100644 --- a/src/backend/commands/proclang.c +++ b/src/backend/commands/proclang.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/proclang.c,v 1.38 2002/07/24 19:11:09 petere Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/proclang.c,v 1.39 2002/08/05 03:29:17 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -119,14 +119,7 @@ CreateProceduralLanguage(CreatePLangStmt *stmt) simple_heap_insert(rel, tup); - if (RelationGetForm(rel)->relhasindex) - { - Relation idescs[Num_pg_language_indices]; - - CatalogOpenIndices(Num_pg_language_indices, Name_pg_language_indices, idescs); - CatalogIndexInsert(idescs, Num_pg_language_indices, rel, tup); - CatalogCloseIndices(Num_pg_language_indices, idescs); - } + CatalogUpdateIndexes(rel, tup); /* * Create dependencies for language -- cgit v1.2.3