aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2021-02-04 17:16:47 +0900
committerMichael Paquier <michael@paquier.xyz>2021-02-04 17:16:47 +0900
commit5128483d064038702f535aced2cbaa43256db214 (patch)
treec73734447e578589b6e9da83152e0defd0e08d6b /src
parentfc749bc7041cb77b5f6b58c129ad2616a3f7ab4f (diff)
downloadpostgresql-5128483d064038702f535aced2cbaa43256db214.tar.gz
postgresql-5128483d064038702f535aced2cbaa43256db214.zip
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 c5b28604.
Diffstat (limited to 'src')
-rw-r--r--src/backend/catalog/index.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 5a70fe4d2c4..1cb9172a5f3 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -3712,6 +3712,12 @@ reindex_index(Oid indexId, bool skip_constraint_checks, char persistence,
{
/* Update its pg_class row */
SetRelationTableSpace(iRel, params->tablespaceOid, InvalidOid);
+
+ /*
+ * Schedule unlinking of the old index storage at transaction
+ * commit.
+ */
+ RelationDropStorage(iRel);
RelationAssumeNewRelfilenode(iRel);
/* Make sure the reltablespace change is visible */