Re: SELECT results in "ERROR: index key does not match expected index column"

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Manuel Rigger <rigger(dot)manuel(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: SELECT results in "ERROR: index key does not match expected index column"
Date: 2019-07-02 23:44:53
Message-ID: CA+hUKGJPdWgC1pY5EmDv8z71VKwNXN9cz_2Lk=6TX_hjzbh_vw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, Jul 3, 2019 at 10:50 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> 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 ...

Git bisect points to this commit as the one that fixed the problem:

commit 1a8d5afb0dfc5d0dcc6eda0656a34cb1f0cf0bdf
Author: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Date: Sat Feb 9 17:30:43 2019 -0500

Refactor the representation of indexable clauses in IndexPaths.

--
Thomas Munro
https://enterprisedb.com

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2019-07-02 23:45:53 Re: SELECT results in "ERROR: index key does not match expected index column"
Previous Message Gavin Flower 2019-07-02 23:11:57 Re: SELECT results in "ERROR: index key does not match expected index column"