Hi everyone,
Consider the following test case:
CREATE TABLE t0(c0 boolean UNIQUE);
CREATE INDEX i0 ON t0((nullif(FALSE, TRUE)));
INSERT INTO t0(c0) VALUES(TRUE);
SELECT * FROM t0 WHERE nullif(FALSE, TRUE) OR t0.c0; -- expected: row
is fetched, actual: ERROR: index key does not match expected index
column
The SELECT above results in an error, which is unexpected. When
removing the UNIQUE keyword from c0, the CREATE INDEX statement, or
the OR t0.c0 in the query, the error does not occur. The error can
also be reproduced with other data types, such as INT.
I'm using the following Postgres version: psql (11.4 (Ubuntu
11.4-1.pgdg19.04+1)).
Best,
Manuel