Below, the second row should be inserted because there is no conflict possible when b is 0.
root@127.0.0.1:53772/defaultdb> create table t (a int, b int, s string, unique index (a) where b > 0);
CREATE TABLE
Time: 6.058ms
root@127.0.0.1:53772/defaultdb> insert into t values (1, 1, 'foo') on conflict (a) do update set s = 'conflict';
INSERT 1
Time: 1.82ms
root@127.0.0.1:53772/defaultdb> select * from t;
a | b | s
----+---+------
1 | 1 | foo
(1 row)
Time: 613µs
root@127.0.0.1:53772/defaultdb> insert into t values (1, 0, 'foo2') on conflict (a) do update set s = 'conflict';
INSERT 1
Time: 1.85ms
root@127.0.0.1:53772/defaultdb> select * from t;
a | b | s
----+---+-----------
1 | 1 | conflict
(1 row)
Time: 599µs
Below, the second row should be inserted because there is no conflict possible when
bis0.