使用 on restrict constraint postgres 删除
Deletion with on restrict constraint postgres
如果有restrict约束,是否可以在postgres中删除行"on cascade"?
是否可以将所有限制约束自动更改为级联约束?
两者都不可能。您的选择是:
DROP CONSTRAINT
、DELETE
和 ADD CONSTRAINT
或
DROP CONSTRAINT
、ADD CONSTRAINT ... ON DELETE CASCADE
和 DELETE
从 PostgreSQL 文档中,您可以看到可以对 table 约束进行哪些更改:
I. SQL Commands - ALTER TABLE
如果有restrict约束,是否可以在postgres中删除行"on cascade"? 是否可以将所有限制约束自动更改为级联约束?
两者都不可能。您的选择是:
DROP CONSTRAINT
、DELETE
和ADD CONSTRAINT
或
DROP CONSTRAINT
、ADD CONSTRAINT ... ON DELETE CASCADE
和DELETE
从 PostgreSQL 文档中,您可以看到可以对 table 约束进行哪些更改: I. SQL Commands - ALTER TABLE