Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZKDv7-0001dD-2i for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Jul 2015 23:04:25 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZKDv6-0004Aa-Kx for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Jul 2015 23:04:24 +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.84) (envelope-from ) id 1ZKDv6-0004AU-36 for pgsql-hackers@postgresql.org; Tue, 28 Jul 2015 23:04:24 +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.84) (envelope-from ) id 1ZKDv3-00078E-7O for pgsql-hackers@postgresql.org; Tue, 28 Jul 2015 23:04:23 +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 t6SN4AsP032729; Tue, 28 Jul 2015 19:04:10 -0400 From: Tom Lane To: Alvaro Herrera cc: Andreas Seltenreich , pgsql-hackers@postgresql.org Subject: Re: Failing assertions in indxpath.c, placeholder.c and brin_minmax.c In-reply-to: <20150728183942.GA2441@postgresql.org> References: <871tfv3wor.fsf@ex.ansel.ydns.eu> <20646.1437919632@sss.pgh.pa.us> <20150728183942.GA2441@postgresql.org> Comments: In-reply-to Alvaro Herrera message dated "Tue, 28 Jul 2015 15:39:42 -0300" Date: Tue, 28 Jul 2015 19:04:10 -0400 Message-ID: <32728.1438124650@sss.pgh.pa.us> X-Pg-Spam-Score: -3.3 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Alvaro Herrera writes: > Tom Lane wrote: >> Bottom line is that somebody failed to consider the possibility of a >> null comparison value reaching the BRIN index lookup machinery. >> The code stanza that's failing supposes that only IS NULL or IS NOT NULL >> tests could have SK_ISNULL set, but that's just wrong. > I think the easiest way to solve this is to consider that all indexable > operators are strict, and have the function return false in that case. > The attached patch implements that. This looks fine to me as a localized fix. I was wondering whether we could short-circuit the index lookup further upstream, but I take it from your comment about _bt_preprocess_keys that BRIN has no convenient place for that today. (Even if it did, I'd still vote for making this change, for safety's sake.) regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers