By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
| version |
|---|
| PostgreSQL 15.0 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-10), 64-bit |
SELECT 1
CREATE TABLE
CREATE INDEX
CREATE INDEX
INSERT 0 1
ERROR: duplicate key value violates unique constraint "match_round_least_idx" DETAIL: Key (round, LEAST(home, away))=(1, Barcelona) already exists.
ERROR: duplicate key value violates unique constraint "match_round_greatest_idx" DETAIL: Key (round, GREATEST(home, away))=(1, Real) already exists.
ERROR: duplicate key value violates unique constraint "match_round_least_idx" DETAIL: Key (round, LEAST(home, away))=(1, Barcelona) already exists.
| round | home | away |
|---|---|---|
| 1 | Barcelona | Real |
SELECT 1