Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 275411337B49 for ; Mon, 15 Nov 2010 12:51:57 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 51517-09 for ; Mon, 15 Nov 2010 16:51:49 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id B20C01337990 for ; Mon, 15 Nov 2010 12:51:49 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id oAFGpkHI016033; Mon, 15 Nov 2010 11:51:46 -0500 (EST) To: Yeb Havinga cc: Heikki Linnakangas , pgsql-bugs@postgresql.org Subject: Re: BUG #5748: Invalid oidvector data during binary recv In-reply-to: <14024.1289834527@sss.pgh.pa.us> References: <201011111430.oABEUVPe067398@wwwmaster.postgresql.org> <15298.1289490490@sss.pgh.pa.us> <4CDC1380.2090309@enterprisedb.com> <4CE10697.3050309@gmail.com> <4CE10E39.9080806@enterprisedb.com> <4CE111D6.5070801@gmail.com> <14024.1289834527@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Mon, 15 Nov 2010 10:22:07 -0500" Date: Mon, 15 Nov 2010 11:51:46 -0500 Message-ID: <16032.1289839906@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201011/104 X-Sequence-Number: 28684 I wrote: > Yeb Havinga writes: >> Binary send and recv of the value at hand would change it into a 0-D vector. > The reason for that is that in general we don't make a distinction > between zero-size arrays of different dimensions. Actually, after consuming a bit more caffeine, I see what Yeb is on about. Even though the system in general doesn't make much of a distinction between zero-element arrays of different dimensionalities, there *are* functions that can distinguish --- array_ndims() being the most obvious one. Shouldn't we ensure that binary dump and reload of an array value doesn't change the value in any SQL-observable way? If so, I think his patch is correct, even though it's changing more than just the originally-complained-of behavior. While I'm looking at this ... why is it that array_ndims returns NULL and not 0 for a zero-dimensional array? 0-D arrays might have been unsupported at one time, but they're certainly considered valid now. regards, tom lane