Re: SELECT results in "ERROR: index key does not match expected index column" - Mailing list pgsql-bugs

From Tom Lane
Subject Re: SELECT results in "ERROR: index key does not match expected index column"
Date
Msg-id 17559.1562107820@sss.pgh.pa.us
Whole thread Raw
In response to SELECT results in "ERROR: index key does not match expected index column"  (Manuel Rigger <rigger.manuel@gmail.com>)
Responses Re: SELECT results in "ERROR: index key does not match expected indexcolumn"  (Gavin Flower <GavinFlower@archidevsys.co.nz>)
Re: SELECT results in "ERROR: index key does not match expected index column"  (Thomas Munro <thomas.munro@gmail.com>)
Re: SELECT results in "ERROR: index key does not match expected index column"  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
List pgsql-bugs
Manuel Rigger <rigger.manuel@gmail.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



pgsql-bugs by date:

Previous
From: Manuel Rigger
Date:
Subject: SELECT results in "ERROR: index key does not match expected index column"
Next
From: Gavin Flower
Date:
Subject: Re: SELECT results in "ERROR: index key does not match expected indexcolumn"