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

From Manuel Rigger
Subject SELECT results in "ERROR: index key does not match expected index column"
Date
Msg-id CA+u7OA4CV21mUfwjQj3va7MWvqB2EAdJT31=uf_yArBRVzQjYw@mail.gmail.com
Whole thread Raw
Responses Re: SELECT results in "ERROR: index key does not match expected index column"  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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



pgsql-bugs by date:

Previous
From: Manuel Rigger
Date:
Subject: Re: GROUP BY and inheritance issue
Next
From: Tom Lane
Date:
Subject: Re: SELECT results in "ERROR: index key does not match expected index column"