diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2001-11-20 02:46:13 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2001-11-20 02:46:13 +0000 |
commit | 604f54cd2728d01cd4716664644fd466d64e9e5d (patch) | |
tree | 46ebe34e27b1714f71c9eb8fd6f6ee238707c7f3 /src/backend/commands/indexcmds.c | |
parent | fb726283b60572dd3390e3f96b85ab21ab3ccc6e (diff) | |
download | postgresql-REL7_2_BETA3.tar.gz postgresql-REL7_2_BETA3.zip |
Some minor tweaks of REINDEX processing: grab exclusive lock a littleREL7_2_BETA3
earlier, make error checks more uniform.
Diffstat (limited to 'src/backend/commands/indexcmds.c')
-rw-r--r-- | src/backend/commands/indexcmds.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c index f6eb6471c0a..a22e111ef4a 100644 --- a/src/backend/commands/indexcmds.c +++ b/src/backend/commands/indexcmds.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/indexcmds.c,v 1.60 2001/10/25 05:49:25 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/indexcmds.c,v 1.61 2001/11/20 02:46:13 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -637,6 +637,9 @@ ReindexDatabase(const char *dbname, bool force, bool all) ALLOCSET_DEFAULT_INITSIZE, ALLOCSET_DEFAULT_MAXSIZE); + /* + * Scan pg_class to build a list of the relations we need to reindex. + */ relationRelation = heap_openr(RelationRelationName, AccessShareLock); scan = heap_beginscan(relationRelation, false, SnapshotNow, 0, NULL); relcnt = relalc = 0; @@ -646,8 +649,6 @@ ReindexDatabase(const char *dbname, bool force, bool all) { if (!IsSystemRelationName(NameStr(((Form_pg_class) GETSTRUCT(tuple))->relname))) continue; - if (((Form_pg_class) GETSTRUCT(tuple))->relhasrules) - continue; } if (((Form_pg_class) GETSTRUCT(tuple))->relkind == RELKIND_RELATION) { @@ -670,6 +671,7 @@ ReindexDatabase(const char *dbname, bool force, bool all) heap_endscan(scan); heap_close(relationRelation, AccessShareLock); + /* Now reindex each rel in a separate transaction */ CommitTransactionCommand(); for (i = 0; i < relcnt; i++) { |