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 3BC6152891 for ; Mon, 6 Jun 2005 12:50:25 -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 15545-04 for ; Mon, 6 Jun 2005 15:50:15 +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 AA3BE528A8 for ; Mon, 6 Jun 2005 12:50:14 -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 2886920; Mon, 06 Jun 2005 09:47:34 -0700 Message-ID: <42A470B5.8060007@joeconway.com> Date: Mon, 06 Jun 2005 08:50:13 -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: =?UTF-8?B?TWFya3VzIEJlcnRoZWF1IOKYrQ==?= Cc: Tom Lane , pgsql-hackers@postgresql.org 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> In-Reply-To: <1118069699.5506.9.camel@dicaprio.akademie1.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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/244 X-Sequence-Number: 68725 Markus Bertheau ☭ wrote: > В Пнд, 06/06/2005 в 10:44 -0400, Tom Lane пишет: >>Markus Bertheau =?UTF-8?Q?=E2=98=AD?= writes: >> >>>By analogy, array_upper('{}'::TEXT[], 1) should return 0 instead of >>>NULL. >> >>No, that doesn't follow ... we've traditionally considered '{}' to >>denote a zero-dimensional array. > > But array_upper(ARRAY(SELECT 1 WHERE FALSE), 1) should return 0, > and array_upper(ARRAY[], 1), when the ARRAY[] syntax is supported, > should return 0. > 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. Joe