Re: [REPOST] plpgsql : looping over multidimensional array : getting NULL for subdimension

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Samba <saasira(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [REPOST] plpgsql : looping over multidimensional array : getting NULL for subdimension
Date: 2010-12-02 17:20:42
Message-ID: AANLkTikGx0t6LnbqXMy_PiRd6kMcd9nfUSjmHtgO52AS@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Dec 2, 2010 at 9:03 AM, Samba <saasira(at)gmail(dot)com> wrote:
> Thank you  Merlin for your answer,
>
>        I tried that and is working as you said.
>        But when I do
>                    other_array=some_array[1:2];
>        I'm getting the entire
> '{{samba,sarath,sreenivas},{samba,mukhesh,pavan}}';
>
>        not just the second subarray, i.e. '{{samba,mukhesh,pavan}}'.
>
>        Is there any way I can get only the corresponding slice of the array?

sure...some_array[2:2], etc

merlin

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Merlin Moncure 2010-12-02 17:34:04 Re: [REPOST] plpgsql : looping over multidimensional array : getting NULL for subdimension
Previous Message Dimitri Fontaine 2010-12-02 16:34:28 Re: Full Text Partial Match at begining