summaryrefslogtreecommitdiff
path: root/src/backend/commands/comment.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-08-05 03:29:17 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-08-05 03:29:17 +0000
commit15fe086fba52bbac7560151e06d1efb3daa69e4a (patch)
treef4213b8a0a5f0be0a4b3c990b5063b800961551f /src/backend/commands/comment.c
parent07f9682de43ce53fcd6d86744f610cacfabc60bb (diff)
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.
Diffstat (limited to 'src/backend/commands/comment.c')
-rw-r--r--src/backend/commands/comment.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/backend/commands/comment.c b/src/backend/commands/comment.c
index 118c2c4b777..e244a82d1ad 100644
--- a/src/backend/commands/comment.c
+++ b/src/backend/commands/comment.c
@@ -7,7 +7,7 @@
* Copyright (c) 1996-2001, PostgreSQL Global Development Group
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/comment.c,v 1.54 2002/08/02 18:15:05 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/comment.c,v 1.55 2002/08/05 03:29:16 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -206,19 +206,9 @@ CreateComments(Oid oid, Oid classoid, int32 subid, char *comment)
}
/* Update indexes, if necessary */
-
if (newtuple != NULL)
{
- if (RelationGetForm(description)->relhasindex)
- {
- Relation idescs[Num_pg_description_indices];
-
- CatalogOpenIndices(Num_pg_description_indices,
- Name_pg_description_indices, idescs);
- CatalogIndexInsert(idescs, Num_pg_description_indices, description,
- newtuple);
- CatalogCloseIndices(Num_pg_description_indices, idescs);
- }
+ CatalogUpdateIndexes(description, newtuple);
heap_freetuple(newtuple);
}