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

From: Manuel Rigger <rigger(dot)manuel(at)gmail(dot)com>
To: PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: SELECT results in "ERROR: index key does not match expected index column"
Date: 2019-07-02 22:00:37
Message-ID: CA+u7OA4CV21mUfwjQj3va7MWvqB2EAdJT31=uf_yArBRVzQjYw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi everyone,

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; -- expected: row
is fetched, actual: ERROR: index key does not match expected index
column

The SELECT above results in an error, which is unexpected. When
removing the UNIQUE keyword from c0, the CREATE INDEX statement, or
the OR t0.c0 in the query, the error does not occur. The error can
also be reproduced with other data types, such as INT.

I'm using the following Postgres version: psql (11.4 (Ubuntu
11.4-1.pgdg19.04+1)).

Best,
Manuel

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2019-07-02 22:50:20 Re: SELECT results in "ERROR: index key does not match expected index column"
Previous Message Manuel Rigger 2019-07-02 21:51:03 Re: GROUP BY and inheritance issue