!1294 Throw execption when setting deferrable on cstore pkey/unique constraint.

Merge pull request !1294 from Yuejia/930_bug_fix
This commit is contained in:
opengauss-bot
2021-09-29 13:00:42 +00:00
committed by Gitee

View File

@ -10493,6 +10493,12 @@ static void ATExecAddIndex(AlteredTableInfo* tab, Relation rel, IndexStmt* stmt,
Assert(IsA(stmt, IndexStmt));
Assert(!stmt->concurrent);
/* Primary key/Unique constraint on cstore does not support deferrable */
if (RelationIsCUFormat(rel) && stmt->isconstraint && (stmt->deferrable || stmt->initdeferred)) {
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("column store unsupport DEFERRABLE/INITIALLY DEFERRED on primary key/unique constraint")));
}
/* suppress schema rights check when rebuilding existing index */
check_rights = !is_rebuild;
/* skip index build if phase 3 will do it or we're reusing an old one */