Manuel Rigger <rigger(dot)manuel(at)gmail(dot)com> writes:
> 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;
> ERROR: index key does not match expected index column
Huh. I don't see that in HEAD/v12, but it does reproduce in v11
and quite a large number of branches before that. Looking ...
(You realize of course that an index on a constant is pretty
useless. I wonder if we should disallow that.)
regards, tom lane