Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 416FC1337B54 for ; Sun, 5 Dec 2010 02:50:53 -0400 (AST) 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 70644-10 for ; Sun, 5 Dec 2010 06:50:53 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from wwwmaster.postgresql.org (wwwmaster.postgresql.org [217.196.146.204]) by mail.postgresql.org (Postfix) with ESMTP id 8DA6F1336FA7 for ; Sun, 5 Dec 2010 02:50:52 -0400 (AST) Received: from wwwmaster.postgresql.org (wwwmaster.postgresql.org [217.196.146.204]) by wwwmaster.postgresql.org (8.14.3/8.14.3) with ESMTP id oB56opXq090788 for ; Sun, 5 Dec 2010 06:50:51 GMT (envelope-from www@wwwmaster.postgresql.org) Received: (from www@localhost) by wwwmaster.postgresql.org (8.14.3/8.14.3/Submit) id oB56opvM090787; Sun, 5 Dec 2010 06:50:51 GMT (envelope-from www) Date: Sun, 5 Dec 2010 06:50:51 GMT Message-Id: <201012050650.oB56opvM090787@wwwmaster.postgresql.org> To: pgsql-bugs@postgresql.org Subject: BUG #5784: CREATE INDEX USING GIN complains about array containing null values yet none exist From: "Martin Atukunda" Content-Type: text/plain; charset=utf-8 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 201012/33 X-Sequence-Number: 28839 The following bug has been logged online: Bug reference: 5784 Logged by: Martin Atukunda Email address: matlads@gmail.com PostgreSQL version: 8.4 Operating system: Linux Description: CREATE INDEX USING GIN complains about array containing null values yet none exist Details: CREATE INDEX USING GIN complains about array containing null values yet none exist. Take the following SQL as an example. -- >8 -- BEGIN; CREATE TABLE t (id serial primary key, apps bigint[]); INSERT INTO t (apps) VALUES ('{1,2,3,4}'); INSERT INTO t (apps) VALUES ('{1,2,3,4}'); -- insert an array with one element as a null value INSERT INTO t (apps) VALUES ('{1,2,3,NULL}'); -- remove the null value UPDATE t SET apps[4] = -1 WHERE apps[4] IS NULL; -- the create index fails CREATE INDEX t_apps_idx ON t USING GIN(apps); COMMIT; -- 8< -- note that index creatiion succeeds if I first create the index without inserting a row containing an array with a null element. - Martin -