Skip to content

Commit 289198c

Browse files
committed
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/20190122080852.GB3873@paquier.xyz
1 parent 9593113 commit 289198c

File tree

5 files changed

+5
-12
lines changed

5 files changed

+5
-12
lines changed

src/backend/bootstrap/bootstrap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1130,7 +1130,7 @@ build_indices(void)
11301130
heap = table_open(ILHead->il_heap, NoLock);
11311131
ind = index_open(ILHead->il_ind, NoLock);
11321132

1133-
index_build(heap, ind, ILHead->il_info, false, false, false);
1133+
index_build(heap, ind, ILHead->il_info, false, false);
11341134

11351135
index_close(ind, NoLock);
11361136
table_close(heap, NoLock);

src/backend/catalog/heap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3063,7 +3063,7 @@ RelationTruncateIndexes(Relation heapRelation)
30633063

30643064
/* Initialize the index and rebuild */
30653065
/* Note: we do not need to re-establish pkey setting */
3066-
index_build(heapRelation, currentIndex, indexInfo, false, true, false);
3066+
index_build(heapRelation, currentIndex, indexInfo, true, false);
30673067

30683068
/* We're done with this index */
30693069
index_close(currentIndex, NoLock);

src/backend/catalog/index.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,8 +1189,7 @@ index_create(Relation heapRelation,
11891189
}
11901190
else
11911191
{
1192-
index_build(heapRelation, indexRelation, indexInfo, isprimary, false,
1193-
true);
1192+
index_build(heapRelation, indexRelation, indexInfo, false, true);
11941193
}
11951194

11961195
/*
@@ -2220,13 +2219,9 @@ index_update_stats(Relation rel,
22202219
* entries of the index and heap relation as needed, using statistics
22212220
* returned by ambuild as well as data passed by the caller.
22222221
*
2223-
* isprimary tells whether to mark the index as a primary-key index.
22242222
* isreindex indicates we are recreating a previously-existing index.
22252223
* parallel indicates if parallelism may be useful.
22262224
*
2227-
* Note: when reindexing an existing index, isprimary can be false even if
2228-
* the index is a PK; it's already properly marked and need not be re-marked.
2229-
*
22302225
* Note: before Postgres 8.2, the passed-in heap and index Relations
22312226
* were automatically closed by this routine. This is no longer the case.
22322227
* The caller opened 'em, and the caller should close 'em.
@@ -2235,7 +2230,6 @@ void
22352230
index_build(Relation heapRelation,
22362231
Relation indexRelation,
22372232
IndexInfo *indexInfo,
2238-
bool isprimary,
22392233
bool isreindex,
22402234
bool parallel)
22412235
{
@@ -3702,7 +3696,7 @@ reindex_index(Oid indexId, bool skip_constraint_checks, char persistence,
37023696

37033697
/* Initialize the index and rebuild */
37043698
/* Note: we do not need to re-establish pkey setting */
3705-
index_build(heapRelation, iRel, indexInfo, false, true, true);
3699+
index_build(heapRelation, iRel, indexInfo, true, true);
37063700
}
37073701
PG_CATCH();
37083702
{

src/backend/commands/indexcmds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1168,7 +1168,7 @@ DefineIndex(Oid relationId,
11681168
indexInfo->ii_BrokenHotChain = false;
11691169

11701170
/* Now build the index */
1171-
index_build(rel, indexRelation, indexInfo, stmt->primary, false, true);
1171+
index_build(rel, indexRelation, indexInfo, false, true);
11721172

11731173
/* Close both the relations, but keep the locks */
11741174
table_close(rel, NoLock);

src/include/catalog/index.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ extern void FormIndexDatum(IndexInfo *indexInfo,
107107
extern void index_build(Relation heapRelation,
108108
Relation indexRelation,
109109
IndexInfo *indexInfo,
110-
bool isprimary,
111110
bool isreindex,
112111
bool parallel);
113112

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy