Postgres最近变得非常烦人。
我已经检查了Oracle提供的文档,并找到了一种方法,而不会丢弃表。问题是,它在修改时出错,因为它不能识别关键字。
使用EMS sql Manager for Postgresql。
Alter table public.public_insurer_credit MODIFY CONSTRAINT public_insurer_credit_fk1 deferrable,initially deferred;
ALTER TABLE "public"."public_insurer_credit" DROP CONSTRAINT "public_insurer_credit_fk1" RESTRICT; ALTER TABLE "public"."public_insurer_credit" ADD CONSTRAINT "public_insurer_credit_fk1" FOREIGN KEY ("branch_id","order_id","public_insurer_id") REFERENCES "public"."order_public_insurer"("branch_id","public_insurer_id") ON UPDATE CASCADE ON DELETE NO ACTION DEFERRABLE INITIALLY DEFERRED;
根据正确的手册(由Postgresql提供,不是由Oracle提供),ALTER TABLE语句中没有可用的修改约束:
以下是正确手册的链接:
http://www.postgresql.org/docs/current/static/sql-altertable.html