在postgres 9.5中,我有这样的sql约束:
CONSTRAINT gp_property_name_unique UNIQUE (name, parent_id, active)
只有当parent_id不为null时,才能执行此操作。如果名称字段是根字段,如何确保它是唯一的?(=> parent_id为空)
谢谢。
https://stackoverflow.com/questions/41500154
相似问题