diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c index da9d941f4a1..c5d85eced48 100644 --- a/src/backend/commands/repack.c +++ b/src/backend/commands/repack.c @@ -40,6 +40,7 @@ #include "access/toast_internals.h" #include "access/transam.h" #include "access/xact.h" +#include "access/xlog.h" #include "catalog/catalog.h" #include "catalog/dependency.h" #include "catalog/heap.h" @@ -897,6 +898,14 @@ check_concurrent_repack_requirements(Relation rel, Oid *ident_idx_p) replident; Oid ident_idx; + if (wal_level < WAL_LEVEL_REPLICA) + ereport(ERROR, + errcode(ERRCODE_INVALID_PARAMETER_VALUE), + errmsg("cannot execute \"%s\" in this configuration", + "REPACK (CONCURRENTLY)"), + errdetail("%s requires \"wal_level\" to be set to \"replica\" or higher.", + "REPACK (CONCURRENTLY)")); + /* Data changes in system relations are not logically decoded. */ if (IsCatalogRelation(rel)) ereport(ERROR,