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

From Gavin Flower
Subject Re: SELECT results in "ERROR: index key does not match expected indexcolumn"
Date
Msg-id 16b7e20c-9df2-6c6e-c5fa-f7dec37b7d29@archidevsys.co.nz
Whole thread Raw
In response to Re: SELECT results in "ERROR: index key does not match expected index column"  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: SELECT results in "ERROR: index key does not match expected index column"  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
On 03/07/2019 10:50, Tom Lane wrote:
> 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
>
>
I think it should cause an error, most likely an unintentional 
implementation mistake -- so the sooner it is flagged the better to 
remedy it!


Cheers,
Gavin




pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: SELECT results in "ERROR: index key does not match expected index column"
Next
From: Thomas Munro
Date:
Subject: Re: SELECT results in "ERROR: index key does not match expected index column"