Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id BD59D1337B43 for ; Sun, 5 Dec 2010 08:29:45 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 54124-07 for ; Sun, 5 Dec 2010 12:29:38 +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 DF89E1336FA7 for ; Sun, 5 Dec 2010 08:29:37 -0400 (AST) Received: from alap2.localnet (unknown [88.128.88.205]) by mail.anarazel.de (Postfix) with ESMTPSA id 56E53448005; Sun, 5 Dec 2010 13:29:37 +0100 (CET) From: Andres Freund To: Martin Atukunda Subject: Re: BUG #5784: CREATE INDEX USING GIN complains about array containing null values yet none exist Date: Sun, 5 Dec 2010 13:29:35 +0100 User-Agent: KMail/1.13.5 (Linux/2.6.36-rc6-andres-00006-g4193d91; KDE/4.5.1; x86_64; ; ) Cc: pgsql-bugs@postgresql.org References: <201012050650.oB56opvM090787@wwwmaster.postgresql.org> <201012051239.23510.andres@anarazel.de> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201012051329.35665.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/36 X-Sequence-Number: 28842 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[]; could work. Andres