From: Tom Lane <tgl@sss.pgh.pa.us>
To: Manuel Rigger <rigger.manuel@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: SELECT results in "ERROR: index key does not match expected index column"
Date: Tue, 02 Jul 2019 18:50:20 -0400
Message-ID: <17559.1562107820@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+u7OA4CV21mUfwjQj3va7MWvqB2EAdJT31=uf_yArBRVzQjYw@mail.gmail.com>
References: <CA+u7OA4CV21mUfwjQj3va7MWvqB2EAdJT31=uf_yArBRVzQjYw@mail.gmail.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, rigger.manuel@gmail.com
Subject: Re: SELECT results in "ERROR: index key does not match expected index column"
In-Reply-To: <17559.1562107820@sss.pgh.pa.us>
References: <CA+u7OA4CV21mUfwjQj3va7MWvqB2EAdJT31=uf_yArBRVzQjYw@mail.gmail.com> <17559.1562107820@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox