Firebird 2.5丢弃约束错误

时间:2015-07-28 18:35:34

标签: sql firebird interbase

我在WinXP上使用Firebird 2.5.4。 我有一个具有以下结构的表:

CREATE TABLE "MY_TABLE_1"
(
  "ID" "D_ID" NOT NULL,
  ...
  "WHATEVER" VARCHAR(20) CHARACTER SET WIN1250 COLLATE PXW_HUN,
  ...
  CONSTRAINT "C_MY_TABLE_1_U1" UNIQUE ("WHATEVER"),
  PRIMARY KEY ("ID")
);

我想删除“C_MY_TABLE_1_U1”约束:

ALTER TABLE MY_TABLE_1 DROP CONSTRAINT C_MY_TABLE_1_U1;

然后我收到了这个错误:

unsuccessful metadata update
ERASE RDB$RELATION_CONSTRAINTS failed
index unexpectedly deleted
At trigger 'RDB$TRIGGER_19'
At trigger 'RDB$TRIGGER_11'

我在哪里失败?

2 个答案:

答案 0 :(得分:1)

我添加了

CREATE DOMAIN "D_ID" BIGINT;

因为需要测试ypur脚本并且没有错误(FB 2.5.4)。

您是否可以更具体地了解出现错误的OS / FB版本?

CREATE DOMAIN "D_ID" BIGINT;
CREATE TABLE "MY_TABLE_1"
(
   "ID" "D_ID" NOT NULL,
   "WHATEVER" VARCHAR(20) CHARACTER SET WIN1250 COLLATE PXW_HUN,
   CONSTRAINT "C_MY_TABLE_1_U1" UNIQUE ("WHATEVER"),
   PRIMARY KEY ("ID")
);

ALTER TABLE MY_TABLE_1 DROP CONSTRAINT C_MY_TABLE_1_U1;

答案 1 :(得分:1)

数据库已损坏,备份/恢复后我能够删除约束。