Custom unique column constraint, only enforced if one column has a specific value
-
31-10-2019 - |
Question
Is it possible to have a custom unique column constraint as follows? Suppose I have two cols, subset
and type
, both strings (though the data types probably doesn't matter).
If type
is "true", then I want the combination of type
and subset
to be unique. Otherwise, there is no constraint. I'm using PostgreSQL 8.4 on Debian.
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange