Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 4FC5D1337B68 for ; Mon, 6 Dec 2010 18:20:57 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 22759-04 for ; Mon, 6 Dec 2010 22:20:50 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from exprod7og114.obsmtp.com (exprod7og114.obsmtp.com [64.18.2.215]) by mail.postgresql.org (Postfix) with SMTP id 208931337B54 for ; Mon, 6 Dec 2010 18:20:48 -0400 (AST) Received: from source ([74.125.82.41]) by exprod7ob114.postini.com ([64.18.6.12]) with SMTP ID DSNKTP1hwFes16QRJGcUZOAPQe0cIHfksZwA@postini.com; Mon, 06 Dec 2010 14:20:49 PST Received: by wwi18 with SMTP id 18so4369573wwi.2 for ; Mon, 06 Dec 2010 14:20:47 -0800 (PST) Received: by 10.227.142.133 with SMTP id q5mr6434262wbu.3.1291674047283; Mon, 06 Dec 2010 14:20:47 -0800 (PST) Received: from [192.168.48.120] ([217.111.66.10]) by mx.google.com with ESMTPS id f35sm3781917wbf.20.2010.12.06.14.20.46 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 06 Dec 2010 14:20:46 -0800 (PST) Message-ID: <4CFD61BE.7060301@enterprisedb.com> Date: Mon, 06 Dec 2010 23:20:46 +0100 From: Heikki Linnakangas User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; fi-FI; rv:1.9.1.15) Gecko/20101030 Icedove/3.0.10 MIME-Version: 1.0 To: Tom Lane CC: Andres Freund , pgsql-bugs@postgresql.org, Martin Atukunda Subject: Re: BUG #5784: CREATE INDEX USING GIN complains about array containing null values yet none exist References: <201012050650.oB56opvM090787@wwwmaster.postgresql.org> <201012051358.22813.andres@anarazel.de> <26122.1291567379@sss.pgh.pa.us> <201012051806.20719.andres@anarazel.de> <26741.1291570005@sss.pgh.pa.us> In-Reply-To: <26741.1291570005@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.083 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_IN_BL_SPAMCOP_NET=1.347, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_SORBS_WEB=0.77 X-Spam-Level: X-Archive-Number: 201012/52 X-Sequence-Number: 28858 On 05.12.2010 18:26, Tom Lane wrote: > Andres Freund writes: >> On Sunday 05 December 2010 17:42:59 Tom Lane wrote: >>> I think the reason the given example fails is just that it's all being >>> done in one transaction. If the null-containing row were known dead >>> it wouldn't get indexed. So: commit. > >> Um I doubt it. > > [ gets out gdb... ] Oh: the reason GIN is complaining is that it's just > looking at ARR_HASNULL(), and the array's has-nulls flag is still set > because we don't bother to try to clear it after replacing one element > of the array. (Which in general would be an expensive thing to try to > do...) > > If we were intending to leave GIN in its current nulls-hating state, > the thing to do would be to replace the stupid ARR_HASNULL check with > something more intelligent. But really it needs to be fixed to handle > nulls properly, so I'm thinking that might be a dead-end patch. Sounds like we'd still want to just replace ARR_HASNULL() with something more intelligent in back-branches though. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com