X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 8CC545289E for ; Mon, 6 Jun 2005 12:58:31 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 17403-07 for ; Mon, 6 Jun 2005 15:58:29 +0000 (GMT) Received: from joeconway.com (wsip-24-249-201-67.sd.sd.cox.net [24.249.201.67]) by svr1.postgresql.org (Postfix) with ESMTP id 55F0E52896 for ; Mon, 6 Jun 2005 12:58:28 -0300 (ADT) Received: from [206.19.64.3] (account jconway HELO [172.16.1.115]) by joeconway.com (CommuniGate Pro SMTP 4.1.8) with ESMTP-TLS id 2886943; Mon, 06 Jun 2005 09:55:48 -0700 Message-ID: <42A472A4.6090505@joeconway.com> Date: Mon, 06 Jun 2005 08:58:28 -0700 From: Joe Conway User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.8) Gecko/20050513 Fedora/1.7.8-1.3.1 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-hackers@postgresql.org Cc: =?UTF-8?B?TWFya3VzIEJlcnRoZWF1IOKYrQ==?= , Tom Lane Subject: Re: [SQL] ARRAY() returning NULL instead of ARRAY[] resp. References: <1116873219.7306.0.camel@localhost.localdomain> <42923762.7010708@joeconway.com> <16774.1116907560@sss.pgh.pa.us> <1118067445.5506.6.camel@dicaprio.akademie1.de> <25974.1118069089@sss.pgh.pa.us> <1118069699.5506.9.camel@dicaprio.akademie1.de> <42A470B5.8060007@joeconway.com> In-Reply-To: <42A470B5.8060007@joeconway.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.048 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200506/245 X-Sequence-Number: 68726 Joe Conway wrote: > Actually, consistent with my last post, I think array_upper() on a > zero-element array should return NULL. A zero-element array has a > defined lower bound, but its upper bound is not zero -- it is really > undefined. Just to clarify my response, this is what I propose: regression=# select array_upper('[2][1:]={{},{}}'::int[],1); array_upper ------------- 2 (1 row) regression=# select array_upper('[2][1:]={{},{}}'::int[],2) IS NULL; ?column? ---------- t (1 row) Joe