Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL) - Mailing list pgsql-hackers

From Gavin Flower
Subject Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL)
Date
Msg-id 515A9A8E.1050902@archidevsys.co.nz
Whole thread Raw
In response to Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL)  (Brendan Jurd <direvus@gmail.com>)
List pgsql-hackers
<div class="moz-cite-prefix">On 29/03/13 13:12, Brendan Jurd wrote:<br /></div><blockquote
cite="mid:CADxJZo3fXdFCNS_sMyAiBgPCzbGLnYwCdnQaXLqARPntD5MFJQ@mail.gmail.com"type="cite"><pre wrap="">On 28 March 2013
20:34,Dean Rasheed <a class="moz-txt-link-rfc2396E"
href="mailto:dean.a.rasheed@gmail.com"><dean.a.rasheed@gmail.com></a>wrote:
 
</pre><blockquote type="cite"><pre wrap="">Is the patch also going to allow empty arrays in higher dimensions
where not just the last dimension is empty?
</pre></blockquote><pre wrap="">
It doesn't allow that at present.

</pre><blockquote type="cite"><pre wrap="">It seems as though, if
it's allowing 1-by-0 arrays like '{{}}' and '[4:4][8:7]={{}}', it
should also allow 0-by-0 arrays like '[4:3][8:7]={}', and 0-by-3
arrays like '[4:3][11:13]={}'.
</pre></blockquote><pre wrap="">
I think the array literal parser would reject this on the grounds that
the brace structure doesn't match the dimension specifiers.  You could
modify that check to respect zero length in dimensions other than the
innermost one, but it's hard to say whether it would be worth the
effort.

It might be instructive to hear from somebody who does (or intends to)
use multidim arrays for some practical purpose, but I don't even know
whether such a person exists within earshot of this list.

Cheers,
BJ


</pre></blockquote><font size="-1">Multiple dimension arrays. 'might' be something I may need, or at least usefully use
inmy current p<font size="-1">roject</font></font>.<br /><br /> I am not ready to do the database design to that detail
yet.<br/><br /> However, I know I will need to do 'clever'(TM) things with multiple images areas on images, and
possiblygroup several images together (and still access their individual image areas).  So potentially arrays of
dimension2 or greater may be useful.  Certainly, some images will not have any image areas defined, some arrays might
beempty.<br /><br /><br /> Cheers,<br /> Gavin<br /><br /><br /> 

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Page replacement algorithm in buffer cache
Next
From: Simon Riggs
Date:
Subject: Re: regression test failed when enabling checksum