Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1erUzC-0000Bs-Of for pgsql-bugs@arkaria.postgresql.org; Thu, 01 Mar 2018 20:39:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1erUzB-0005uX-5Y for pgsql-bugs@arkaria.postgresql.org; Thu, 01 Mar 2018 20:39:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1erUzA-0005uO-VW for pgsql-bugs@lists.postgresql.org; Thu, 01 Mar 2018 20:39:29 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1erUz6-0002sd-Jz for pgsql-bugs@lists.postgresql.org; Thu, 01 Mar 2018 20:39:28 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w21KdIR6022610; Thu, 1 Mar 2018 15:39:18 -0500 From: Tom Lane To: Kyotaro HORIGUCHI cc: sk@zsrv.org, michael.paquier@gmail.com, x4mmm@yandex-team.ru, david@nlpgo.com, pgsql-bugs@lists.postgresql.org, pgsql-hackers@postgresql.org Subject: Re: Index-only scan returns incorrect results when using a composite GIST index with a gist_trgm_ops column. In-reply-to: <20180124.161153.214591193.horiguchi.kyotaro@lab.ntt.co.jp> References: <20180118082505.GA84508@paquier.xyz> <20180118.211449.240575561.horiguchi.kyotaro@lab.ntt.co.jp> <348951516742031@web54j.yandex.ru> <20180124.161153.214591193.horiguchi.kyotaro@lab.ntt.co.jp> Comments: In-reply-to Kyotaro HORIGUCHI message dated "Wed, 24 Jan 2018 16:11:53 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <22608.1519936758.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 01 Mar 2018 15:39:18 -0500 Message-ID: <22609.1519936758@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Kyotaro HORIGUCHI writes: > At Wed, 24 Jan 2018 00:13:51 +0300, Sergei Kornilov wrote = in <348951516742031@web54j.yandex.ru> >> Should we also make backport to older versions? I test on REL_10_STABLE= - patch builds and works ok, but "make check" fails on new testcase with = error: > CREATE INDEX ON t USING gist (a test_inet_ops, a inet_ops); > + ERROR: missing support function 4 for attribute 1 of index "t_a_a1_id= x" >> and with different explain results. > Thank you for checking that. d3a4f89 allowed that and > inet_gist_decompress is removed at the same time. Unfortunately I > didn't find a type on master that has both decompress and fetch > methods so I prefer to split the regression patch among target > versions. I pushed this fix with minor adjustments. I did not like the proposed regression test at all: it was overcomplicated and the need for different versions for different back branches wasn't fun either. After some poking around I found that the bug could be exhibited using just btree_gist's gist_inet_ops, since the core inet_ops class indexes the same datatype and it does have a fetch function. So I added a test case in btree_gist. regards, tom lane