Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit b940918

Browse files
committed
Remove "recheck" argument from check_index_is_clusterable()
The last usage of this argument in this routine can be tracked down to 7e2f906, aka 11 years ago. Getting rid of this argument can also be an advantage for extensions calling check_index_is_clusterable(), as it removes any need to worry about the meaning of what a recheck would be at this level. Author: Justin Pryzby Discussion: https://postgr.es/m/20220411140609.GF26620@telsasoft.com
1 parent fdc18ea commit b940918

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/backend/commands/cluster.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ cluster(ParseState *pstate, ClusterStmt *stmt, bool isTopLevel)
232232
if (rel != NULL)
233233
{
234234
Assert(rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE);
235-
check_index_is_clusterable(rel, indexOid, true, AccessShareLock);
235+
check_index_is_clusterable(rel, indexOid, AccessShareLock);
236236
rtcs = get_tables_to_cluster_partitioned(cluster_context, indexOid);
237237

238238
/* close relation, releasing lock on parent table */
@@ -434,7 +434,7 @@ cluster_rel(Oid tableOid, Oid indexOid, ClusterParams *params)
434434

435435
/* Check heap and index are valid to cluster on */
436436
if (OidIsValid(indexOid))
437-
check_index_is_clusterable(OldHeap, indexOid, recheck, AccessExclusiveLock);
437+
check_index_is_clusterable(OldHeap, indexOid, AccessExclusiveLock);
438438

439439
/*
440440
* Quietly ignore the request if this is a materialized view which has not
@@ -480,7 +480,7 @@ cluster_rel(Oid tableOid, Oid indexOid, ClusterParams *params)
480480
* protection here.
481481
*/
482482
void
483-
check_index_is_clusterable(Relation OldHeap, Oid indexOid, bool recheck, LOCKMODE lockmode)
483+
check_index_is_clusterable(Relation OldHeap, Oid indexOid, LOCKMODE lockmode)
484484
{
485485
Relation OldIndex;
486486

src/backend/commands/tablecmds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14055,7 +14055,7 @@ ATExecClusterOn(Relation rel, const char *indexName, LOCKMODE lockmode)
1405514055
indexName, RelationGetRelationName(rel))));
1405614056

1405714057
/* Check index is valid to cluster on */
14058-
check_index_is_clusterable(rel, indexOid, false, lockmode);
14058+
check_index_is_clusterable(rel, indexOid, lockmode);
1405914059

1406014060
/* And do the work */
1406114061
mark_index_clustered(rel, indexOid, false);

src/include/commands/cluster.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ typedef struct ClusterParams
3434
extern void cluster(ParseState *pstate, ClusterStmt *stmt, bool isTopLevel);
3535
extern void cluster_rel(Oid tableOid, Oid indexOid, ClusterParams *params);
3636
extern void check_index_is_clusterable(Relation OldHeap, Oid indexOid,
37-
bool recheck, LOCKMODE lockmode);
37+
LOCKMODE lockmode);
3838
extern void mark_index_clustered(Relation rel, Oid indexOid, bool is_internal);
3939

4040
extern Oid make_new_heap(Oid OIDOldHeap, Oid NewTableSpace, Oid NewAccessMethod,

0 commit comments

Comments
 (0)