From a40c22e0da5b3382b9c413dc4c7b1ce52760fa14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E8=BE=BE=E6=A0=87?= <848833284@qq.com> Date: Fri, 6 Sep 2024 17:13:31 +0800 Subject: [PATCH] =?UTF-8?q?revert=20xstore=20deferrable=20constraints=20?= =?UTF-8?q?=EF=BC=88cherry=20picked=20commit=20from=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/gausskernel/optimizer/commands/indexcmds.cpp | 9 +++++++++ src/gausskernel/optimizer/commands/tablecmds.cpp | 10 ++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/gausskernel/optimizer/commands/indexcmds.cpp b/src/gausskernel/optimizer/commands/indexcmds.cpp index 07bd4f351..a7c6bde96 100644 --- a/src/gausskernel/optimizer/commands/indexcmds.cpp +++ b/src/gausskernel/optimizer/commands/indexcmds.cpp @@ -839,6 +839,15 @@ ObjectAddress DefineIndex(Oid relationId, IndexStmt* stmt, Oid indexRelationId, if (has_dedup_opt) { elog(ERROR, "Index deduplication is not supported for ustore."); } + if (stmt->deferrable == true) { + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmodule(MOD_EXECUTOR), + errmsg("Ustore table does not support to set deferrable."), + errdetail("N/A"), + errcause("feature not supported"), + erraction("check constraints of columns"))); + } } if (strcmp(stmt->accessMethod, "ubtree") == 0 && diff --git a/src/gausskernel/optimizer/commands/tablecmds.cpp b/src/gausskernel/optimizer/commands/tablecmds.cpp index 88e3c4214..779ce0c8f 100755 --- a/src/gausskernel/optimizer/commands/tablecmds.cpp +++ b/src/gausskernel/optimizer/commands/tablecmds.cpp @@ -14936,6 +14936,16 @@ static ObjectAddress ATExecAddConstraint(List** wqueue, AlteredTableInfo* tab, R (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("column store unsupport constraint \"%s\"", GetConstraintType(newConstraint->contype)))); + if (rel->rd_tam_ops == TableAmUstore && newConstraint->deferrable == true) { + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmodule(MOD_COMMAND), + errmsg("Ustore table does not support to set deferrable."), + errdetail("N/A"), + errcause("feature not supported"), + erraction("check constraints of columns"))); + } + /* * Currently, we only expect to see CONSTR_CHECK and CONSTR_FOREIGN nodes * arriving here (see the preprocessing done in parse_utilcmd.c). Use a