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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Manuel Rigger <rigger(dot)manuel(at)gmail(dot)com>
Cc: 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 22:50:20
Message-ID: 17559.1562107820@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Gavin Flower 2019-07-02 23:11:57 Re: SELECT results in "ERROR: index key does not match expected index column"
Previous Message Manuel Rigger 2019-07-02 22:00:37 SELECT results in "ERROR: index key does not match expected index column"