Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W9PfI-0002S3-Cf for pgsql-bugs@arkaria.postgresql.org; Sat, 01 Feb 2014 01:46:36 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1W9PfH-0006B2-0e for pgsql-bugs@arkaria.postgresql.org; Sat, 01 Feb 2014 01:46:35 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W9PfG-0006Aw-9w for pgsql-bugs@postgresql.org; Sat, 01 Feb 2014 01:46:34 +0000 Received: from wsip-72-214-29-243.sd.sd.cox.net ([72.214.29.243] helo=joeconway.com) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W9PfD-0002uh-AV for pgsql-bugs@postgresql.org; Sat, 01 Feb 2014 01:46:33 +0000 Received: from [192.168.4.41] (account jconway [192.168.4.41] verified) by joeconway.com (CommuniGate Pro SMTP 4.1.8) with ESMTP-TLS id 13672061; Fri, 31 Jan 2014 17:49:16 -0800 Message-ID: <52EC51F5.1020701@joeconway.com> Date: Fri, 31 Jan 2014 17:46:29 -0800 From: Joe Conway User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Bruce Momjian , borz_off@cs.msu.su CC: pgsql-bugs@postgresql.org Subject: Re: BUG #8399: inconsistent input of multidimensional arrays References: <20140201011125.GG19957@momjian.us> In-Reply-To: <20140201011125.GG19957@momjian.us> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -0.9 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 01/31/2014 05:11 PM, Bruce Momjian wrote: > On Tue, Aug 27, 2013 at 08:18:10AM +0000, borz_off@cs.msu.su > wrote: >> PostgreSQL documentation states: >> >> "Multidimensional arrays must have matching extents for each >> dimension. A mismatch causes an error..." >> >> >> This is not completely true: postgres=# select cast('{{1,2}, >> {3}}' as integer[]); ERROR: multidimensional arrays must have >> array expressions with matching dimensions LINE 1: select >> cast('{{1,2}, {3}}' as integer[]); ^ postgres=# select >> cast('{{1}, {2,3}}' as integer[]); int4 ------------------ >> {{1,NULL},{2,3}} (1 row) >> >> >> Trying to use an array constructor yields an expected error in >> both cases. > Joe, does this sound right? I believe back when that 2004 commit was made, arrays did not allow NULL elements at all. So I guess this is an unintended side effect of, or a latent bug exposed by, that change. Let me take a closer look... Joe - -- Joe Conway credativ LLC: http://www.credativ.us Linux, PostgreSQL, and general Open Source Training, Service, Consulting, & 24x7 Support -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJS7FH1AAoJEDfy90M199hlMzUP/1e6h0UioXC7HkEgW4DLrI4v V1lVWu3BB9rmQ6RBJMTA6/wJXm28X5etGrDAt0prQPMsvffNcSxZt5gStmMbvCDo 9+90ZrIYdjNJ8GKzojXYsPj7YDzXgkroyYIYW7fUyzjsJqDt8pfR8da5qDJeWyS8 44teI7hWd4RDRK2kBZlpr6gk/J8CSawBR9Noh5PdG1M39oeep2DcdjLbj+XNZB33 by4KiGi+Al8gLLpmyCZCVCukK92MrmOrauz9gyOto6wdcMjyb+rzdLnyAPUG5B/m Kk+1UZhWSKKVi4DlujHOwzvAOlLpVMSYyPb5nwACkc2dDo42Huy3hyP83lSfaCiQ Qkfvu4XglLvio0T/Ym1+dHYAEOdxn3ZdJDK2/UUuPTZwDjQbbI1+hHdIL3cJg7eH imBSQz3aiaoOL98/CBtwOromNEeKlLzqLqVZO9qiJgWJlLgbXtJEGRjp/BKYZwYy EFwxGPL0kEyS8LcGZbGVrRWrXgYerzhYahKuVgtV26HlNeml2c7bd0g7ldM5Tzzc K8g6/sH1/Kx0DUsRsx2EiCitC9DE3mXn5ZYsWxMTYduFPR6T6qcCkNML6ZlSWhHS Oi/bcQs3sNLOyCmkcXbxPHHTfPtrX7Zenj8JPSh8tkDmup9YqmtD1QHsqySxKpK1 eDWexdJBD/Ds5waDGitk =9ygd -----END PGP SIGNATURE----- -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs