summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Paquier2019-01-23 22:57:09 +0000
committerMichael Paquier2019-01-23 22:57:09 +0000
commit289198c0d93a3d591f379c4134e90275bd426426 (patch)
tree66c166b19b6b8e64aa7be873405aa81fe4298e35
parent95931133a959404cf7320b49058b2f1c2e4606b9 (diff)
Remove argument isprimary from index_build()
The flag was introduced in 3fdeb18, but f66e8bf actually forgot to finish the cleanup as index_update_stats() has simplified its interface. Author: Michael Paquier Discussion: https://postgr.es/m/[email protected]
-rw-r--r--src/backend/bootstrap/bootstrap.c2
-rw-r--r--src/backend/catalog/heap.c2
-rw-r--r--src/backend/catalog/index.c10
-rw-r--r--src/backend/commands/indexcmds.c2
-rw-r--r--src/include/catalog/index.h1
5 files changed, 5 insertions, 12 deletions
diff --git a/src/backend/bootstrap/bootstrap.c b/src/backend/bootstrap/bootstrap.c
index 6677926ae6..4d7ed8ad1a 100644
--- a/src/backend/bootstrap/bootstrap.c
+++ b/src/backend/bootstrap/bootstrap.c
@@ -1130,7 +1130,7 @@ build_indices(void)
heap = table_open(ILHead->il_heap, NoLock);
ind = index_open(ILHead->il_ind, NoLock);
- index_build(heap, ind, ILHead->il_info, false, false, false);
+ index_build(heap, ind, ILHead->il_info, false, false);
index_close(ind, NoLock);
table_close(heap, NoLock);
diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c
index 1153688a1c..cc865de627 100644
--- a/src/backend/catalog/heap.c
+++ b/src/backend/catalog/heap.c
@@ -3063,7 +3063,7 @@ RelationTruncateIndexes(Relation heapRelation)
/* Initialize the index and rebuild */
/* Note: we do not need to re-establish pkey setting */
- index_build(heapRelation, currentIndex, indexInfo, false, true, false);
+ index_build(heapRelation, currentIndex, indexInfo, true, false);
/* We're done with this index */
index_close(currentIndex, NoLock);
diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 5ca0b1eb96..225c078018 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -1189,8 +1189,7 @@ index_create(Relation heapRelation,
}
else
{
- index_build(heapRelation, indexRelation, indexInfo, isprimary, false,
- true);
+ index_build(heapRelation, indexRelation, indexInfo, false, true);
}
/*
@@ -2220,13 +2219,9 @@ index_update_stats(Relation rel,
* entries of the index and heap relation as needed, using statistics
* returned by ambuild as well as data passed by the caller.
*
- * isprimary tells whether to mark the index as a primary-key index.
* isreindex indicates we are recreating a previously-existing index.
* parallel indicates if parallelism may be useful.
*
- * Note: when reindexing an existing index, isprimary can be false even if
- * the index is a PK; it's already properly marked and need not be re-marked.
- *
* Note: before Postgres 8.2, the passed-in heap and index Relations
* were automatically closed by this routine. This is no longer the case.
* The caller opened 'em, and the caller should close 'em.
@@ -2235,7 +2230,6 @@ void
index_build(Relation heapRelation,
Relation indexRelation,
IndexInfo *indexInfo,
- bool isprimary,
bool isreindex,
bool parallel)
{
@@ -3702,7 +3696,7 @@ reindex_index(Oid indexId, bool skip_constraint_checks, char persistence,
/* Initialize the index and rebuild */
/* Note: we do not need to re-establish pkey setting */
- index_build(heapRelation, iRel, indexInfo, false, true, true);
+ index_build(heapRelation, iRel, indexInfo, true, true);
}
PG_CATCH();
{
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 3edc94308e..5b2b8d2969 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1168,7 +1168,7 @@ DefineIndex(Oid relationId,
indexInfo->ii_BrokenHotChain = false;
/* Now build the index */
- index_build(rel, indexRelation, indexInfo, stmt->primary, false, true);
+ index_build(rel, indexRelation, indexInfo, false, true);
/* Close both the relations, but keep the locks */
table_close(rel, NoLock);
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 8daac5663c..330c481a8b 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -107,7 +107,6 @@ extern void FormIndexDatum(IndexInfo *indexInfo,
extern void index_build(Relation heapRelation,
Relation indexRelation,
IndexInfo *indexInfo,
- bool isprimary,
bool isreindex,
bool parallel);