解决postgres不能无效化外键的问题

如题,公司内部系统用的DB从oracle切换到了postgres,

enable/disable fk的写法不能用了。。。

 

网上搜了一下,ms只能用先删除外键,然后重新创建的方式,memo一下。

 

alter table xxxxx drop constraint xxxx_fk;

alter table xxxxx add constraint xxxx_fk foreign key (column1) references yyyyyy (column1);

posted @ 2017-07-05 11:29  呆呆中  阅读(558)  评论(0编辑  收藏  举报