Обсуждение: Unique index on non-erased values

Поиск
Список
Период
Сортировка

Unique index on non-erased values

От
Josep Carles Collazos
Дата:
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