Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id CACFB1337999 for ; Sun, 5 Dec 2010 08:58:32 -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 97665-03 for ; Sun, 5 Dec 2010 12:58:27 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.anarazel.de (mail.anarazel.de [217.115.131.40]) by mail.postgresql.org (Postfix) with ESMTP id 953951336FA7 for ; Sun, 5 Dec 2010 08:58:25 -0400 (AST) Received: from alap2.localnet (unknown [88.128.88.205]) by mail.anarazel.de (Postfix) with ESMTPSA id B3134448006; Sun, 5 Dec 2010 13:58:24 +0100 (CET) From: Andres Freund To: pgsql-bugs@postgresql.org Subject: Re: BUG #5784: CREATE INDEX USING GIN complains about array containing null values yet none exist Date: Sun, 5 Dec 2010 13:58:22 +0100 User-Agent: KMail/1.13.5 (Linux/2.6.36-rc6-andres-00006-g4193d91; KDE/4.5.1; x86_64; ; ) Cc: Martin Atukunda References: <201012050650.oB56opvM090787@wwwmaster.postgresql.org> <201012051329.35665.andres@anarazel.de> In-Reply-To: <201012051329.35665.andres@anarazel.de> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201012051358.22813.andres@anarazel.de> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201012/37 X-Sequence-Number: 28843 On Sunday 05 December 2010 13:29:35 Andres Freund wrote: > On Sunday 05 December 2010 13:07:23 Martin Atukunda wrote: > > > Due to the wonders of MVCC the old row is still available in the heap. > > > Best read the docs about what MVCC means. And as pg's indexes don't > > > care about visibility it will still try to index the "old" row. > > > > Thanks andreas, > > > > so, basically, the only way out of this would be to: > > > > 1. copy out all the rows > > 2. truncate the Tables > > 3. then create the index > > 4. copy in the rows > > Something like: > > ALTER TABLE t ALTER apps TYPE text[]; > ALTER TABLE t ALTER apps TYPE bigint[] USING apps::bigint[]; On further thought the second one ought to be enough. Andres