Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bi3Bv-0000GM-OZ for pgsql-bugs@arkaria.postgresql.org; Thu, 08 Sep 2016 17:32:47 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bi3Bv-0002gT-BW for pgsql-bugs@arkaria.postgresql.org; Thu, 08 Sep 2016 17:32:47 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bi3BH-0001v8-AK for pgsql-bugs@postgresql.org; Thu, 08 Sep 2016 17:32:07 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bi3BE-00078E-G9 for pgsql-bugs@postgresql.org; Thu, 08 Sep 2016 17:32:06 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u88HW24B019963; Thu, 8 Sep 2016 13:32:02 -0400 From: Tom Lane To: Shay Rojansky cc: pgsql-bugs@postgresql.org Subject: Re: Array dimension lost if dimension length is zero In-reply-to: References: Comments: In-reply-to Shay Rojansky message dated "Thu, 08 Sep 2016 17:25:11 -0000" Date: Thu, 08 Sep 2016 13:32:02 -0400 Message-ID: <19962.1473355922@sss.pgh.pa.us> X-Pg-Spam-Score: -3.0 (---) 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 Shay Rojansky writes: > An Npgsql user has reported an edge case use which seems to be a bug. > When sending a multidimensional array to PostgreSQL, if the length of a > dimension is 0, that dimension is lost. That is, the user sends a > 2-dimensional array with 0 for both dimensions; trying to read this back > will return a 1-dimensional array. This is intentional: all empty arrays are alike, with zero dimensions (not one dimension, but none). Probably a lot of these decisions would be made differently if we were starting over in a green field; but since we're not, I'm disinclined to touch it. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs