3 ms·
According to the manual [1], this is one of the standard use cases for partial indexes. See the last section. CREATE UNIQUE INDEX index_name ON table_name (a,
by kijin 15y ago
According to the manual [1], this is one of the standard use cases for partial indexes. See the last section.
CREATE UNIQUE INDEX index_name ON table_name (a, b) WHERE deleted_time IS NULL;
[1] http://www.postgresql.org/docs/9.1/static/indexes-partial.html http://www.postgresql.org/docs/9.1/static/indexes-partial.ht...