I have this table:
CREATE TABLE games (
red int unique,
blue int unique,
unique (LEAST(red, blue), GREATEST(red, blue)),
check (red <> blue)
);
When I try to make the table, it errors syntax error at or near "("
. Are functions like LEAST
and GREATEST
not allowed when making 2 columns unique? The purpose of the least and greatest functions is so that when one ID is in red, it can't also be in another record in the blue column.