1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-24 01:29:19 +03:00

Simplify reindex_relation's API.

For what seem entirely historical reasons, a bitmask "flags" argument was
recently added to reindex_relation without subsuming its existing boolean
argument into that bitmask.  This seems a bit bizarre, so fold them
together.
This commit is contained in:
Tom Lane
2011-04-16 17:26:41 -04:00
parent 121f49a00e
commit 2d3320d3d2
5 changed files with 33 additions and 28 deletions

View File

@@ -1399,10 +1399,10 @@ finish_heap_swap(Oid OIDOldHeap, Oid OIDNewHeap,
* so no chance to reclaim disk space before commit. We do not need a
* final CommandCounterIncrement() because reindex_relation does it.
*/
reindex_flags = REINDEX_SUPPRESS_INDEX_USE;
reindex_flags = REINDEX_REL_SUPPRESS_INDEX_USE;
if (check_constraints)
reindex_flags |= REINDEX_CHECK_CONSTRAINTS;
reindex_relation(OIDOldHeap, false, reindex_flags);
reindex_flags |= REINDEX_REL_CHECK_CONSTRAINTS;
reindex_relation(OIDOldHeap, reindex_flags);
/* Destroy new heap with old filenode */
object.classId = RelationRelationId;

View File

@@ -1566,7 +1566,7 @@ ReindexTable(RangeVar *relation)
ReleaseSysCache(tuple);
if (!reindex_relation(heapOid, true, 0))
if (!reindex_relation(heapOid, REINDEX_REL_PROCESS_TOAST))
ereport(NOTICE,
(errmsg("table \"%s\" has no indexes",
relation->relname)));
@@ -1679,7 +1679,7 @@ ReindexDatabase(const char *databaseName, bool do_system, bool do_user)
StartTransactionCommand();
/* functions in indexes may want a snapshot set */
PushActiveSnapshot(GetTransactionSnapshot());
if (reindex_relation(relid, true, 0))
if (reindex_relation(relid, REINDEX_REL_PROCESS_TOAST))
ereport(NOTICE,
(errmsg("table \"%s.%s\" was reindexed",
get_namespace_name(get_rel_namespace(relid)),

View File

@@ -1080,7 +1080,7 @@ ExecuteTruncate(TruncateStmt *stmt)
/*
* Reconstruct the indexes to match, and we're done.
*/
reindex_relation(heap_relid, true, 0);
reindex_relation(heap_relid, REINDEX_REL_PROCESS_TOAST);
}
}