From: | Michael Glaesemann <grzm(at)seespotcode(dot)net> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | pgsql-general <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Array shift equivalent? |
Date: | 2006-12-06 22:35:57 |
Message-ID: | CC2BA225-8E3C-473F-9006-B3A0E0B3D252@seespotcode.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Dec 7, 2006, at 0:26 , Tom Lane wrote:
> Michael Glaesemann <grzm(at)seespotcode(dot)net> writes:
>> I'm trying to shift the first element off of an array, but I'm just
>> not getting it. I'm not necessarily interested in saving the rest of
>> the array. i just want to get the first element, which in this case
>> is another array.
>
> No, it isn't. What you've got is a 2-D array. I don't think there
> is an operation that will produce a 1-D subset --- the array slice
> subscript operation produces something that's smaller but still has
> the same number of dimensions.
Thanks for the explanation and confirmation. I end up iterating over
the elements of the subarray, so I worked around it by iterating over
this_array[1][i].
Michael Glaesemann
grzm seespotcode net
From | Date | Subject | |
---|---|---|---|
Next Message | stroncococcus | 2006-12-06 22:43:08 | concatenation operator || with "null" array |
Previous Message | Wei Weng | 2006-12-06 22:34:39 | Re: Anything I can do to speed up this query? |