Trying to modify a constraint in PostgreSQL

后端 未结 4 1506
伪装坚强ぢ
伪装坚强ぢ 2021-02-01 11:57

I have checked the documentation provided by Oracle and found a way to modify a constraint without dropping the table. Problem is, it errors out at modify as it does not recogn

4条回答
  •  闹比i
    闹比i (楼主)
    2021-02-01 12:39

    As of version 9.4, PostgreSQL supports ALTER TABLE ... ALTER CONSTRAINT for foreign keys.

    This features will "Allow constraint attributes to be altered, so the default setting of NOT DEFERRABLE can be altered to DEFERRABLE and back." Looking at your question I think that is (kind of) what you have been looking for.

    More detailed information and an example can be found here:
    http://www.depesz.com/2013/06/30/waiting-for-9-4-alter-table-alter-constraint-for-fks/

提交回复
热议问题