Thread: Unique index on non-erased values

Unique index on non-erased values

From
Josep Carles Collazos
Date:
I have a table with users in this manner:

create table users (
                        id char(8) not null,
                        active boolean,
                        erased boolean
                        )
I wat to ensure that the id is a unique index but only among the non-erased
users (Those who erased is false).
Someone can help me ?

An other question. PostgreSQL supports constraints ?
Can I simulate constraints of some manner ?

thx