Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id AB6B2B5DBD0 for ; Tue, 5 Jul 2011 14:57:43 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 69539-07 for ; Tue, 5 Jul 2011 17:57:37 +0000 (UTC) Received: from mx1.hub.org (mx1.hub.org [200.46.208.106]) by mail.postgresql.org (Postfix) with ESMTP id BDC55B5DBE6 for ; Tue, 5 Jul 2011 14:57:37 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mx1.hub.org (Postfix) with ESMTP id 4E94527FDAA4 for ; Tue, 5 Jul 2011 14:57:37 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p65HuLw8021433; Tue, 5 Jul 2011 13:56:21 -0400 (EDT) To: Jeff Davis cc: oleg@sai.msu.su, Denis de Bernardy , Teodor Sigaev , pgsql-bugs@postgresql.org Subject: Re: Re: PG regression with row comparison when btree_gist is enabled (BUG) In-reply-to: <1309886656.3012.83.camel@jdavis> References: <4DF81BA0.3000601@archidevsys.co.nz> <743036.48052.qm@web112401.mail.gq1.yahoo.com> <366790.65150.qm@web112414.mail.gq1.yahoo.com> <1308428403.2597.66.camel@jdavis> <1308504190.2597.71.camel@jdavis> <21086.1309646333@sss.pgh.pa.us> <1309886656.3012.83.camel@jdavis> Comments: In-reply-to Jeff Davis message dated "Tue, 05 Jul 2011 10:24:16 -0700" Date: Tue, 05 Jul 2011 13:56:21 -0400 Message-ID: <21432.1309888581@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201107/41 X-Sequence-Number: 30653 Jeff Davis writes: > I think that ripping out the change to btree_gist is also insufficient; > we would also have to prevent other extensions from doing the same. That > means documenting an odd special case, and testing for it when defining > an opclass. And then we'd probably have to backpatch this kludge. There is that. I doubt it's worth back-patching, though. > Something simpler seems possible here. The root of the problem is that > we're being fooled by GiST opclasses when all we care about are BTree > opclasses anyway. A simple fix would be to introduce a flag > "found_btree_op". If we hit any BTree entries from pg_amop at all, then > we're done after the loop is done. If not, then we negate the op and > loop again. Yeah, I had been thinking along the same lines. It will require duplicating the search loop, which is a bit annoying, but perhaps that could be factored out as a subroutine. regards, tom lane