diff options
Diffstat (limited to 'src/backend/commands/indexcmds.c')
-rw-r--r-- | src/backend/commands/indexcmds.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c index 9869a4dd0e7..661e42fa3a9 100644 --- a/src/backend/commands/indexcmds.c +++ b/src/backend/commands/indexcmds.c @@ -2899,6 +2899,16 @@ ReindexRelationConcurrently(Oid relationOid, int options) (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("cannot reindex system catalogs concurrently"))); + /* + * Don't allow reindex for an invalid index on TOAST table, as + * if rebuild it would not be possible to drop it. + */ + if (IsToastNamespace(get_rel_namespace(relationOid)) && + !get_index_isvalid(relationOid)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot reindex invalid index on TOAST table concurrently"))); + /* Save the list of relation OIDs in private context */ oldcontext = MemoryContextSwitchTo(private_context); |