Skip to content

Commit 5128483

Browse files
committed
Ensure unlinking of old index file with REINDEX (TABLESPACE)
The original versions of the patch included this part, but a mismerge from my side has made this piece go missing. Oversight in c5b2860.
1 parent fc749bc commit 5128483

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/backend/catalog/index.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3712,6 +3712,12 @@ reindex_index(Oid indexId, bool skip_constraint_checks, char persistence,
37123712
{
37133713
/* Update its pg_class row */
37143714
SetRelationTableSpace(iRel, params->tablespaceOid, InvalidOid);
3715+
3716+
/*
3717+
* Schedule unlinking of the old index storage at transaction
3718+
* commit.
3719+
*/
3720+
RelationDropStorage(iRel);
37153721
RelationAssumeNewRelfilenode(iRel);
37163722

37173723
/* Make sure the reltablespace change is visible */

0 commit comments

Comments
 (0)