By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
3 rows affected
1 rows affected
| user_id | enabled | enabled_first |
|---|---|---|
| 123 | f | t |
| 123 | t | t |
| 123 | t | f |
| 456 | t | t |
ERROR: duplicate key value violates unique constraint "tbl_pkey"
DETAIL: Key (user_id, enabled, enabled_first)=(123, t, t) already exists.
1 rows affected
| user_id | enabled | enabled_first |
|---|---|---|
| 123 | f | t |
| 123 | t | t |
| 123 | t | f |
| 456 | t | t |
| 123 | f | f |