[REPOST] plpgsql : looping over multidimensional array : getting NULL for subdimension - Mailing list pgsql-general

From Samba
Subject [REPOST] plpgsql : looping over multidimensional array : getting NULL for subdimension
Date
Msg-id AANLkTikOO+Y8VGPMsogCx_rECmxgdLE4e7K3Tyq+LTab@mail.gmail.com
Whole thread Raw
Responses Re: [REPOST] plpgsql : looping over multidimensional array : getting NULL for subdimension
List pgsql-general
Hi all,

I'm trying to loop over a multidimensional array and find if any of the elements in a sub-dimensional array are matching some known criteria but facing issue with NULL for the sub arrays.

I have a data structure that looks like:

   some_array VARCHAR[][] := '{{samba,sarath,sreenivas},{samba,mukhesh,pavan}}';

I'm trying to assign the individual sub arrays to other array elements like:

  other-array VARCHAR[];

  other_array=some_array[1];


and I'm expecting to get '{samba,sarath,sreenivas}' for index 1 and {samba,mukhesh,pavan} for index 2;
however, I'm getting NULL.

Can some one explain the way I can assign subarrays to other array elements plpgsql?

Thanks and Regards,
Samba

PS;
Sorry for spamming but my earlier mail was having some issue with the Subject line because of  resending stalled post.

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Cannot start Postgres- FATAL: invalid cache id: 19
Next
From: Gary Chambers
Date:
Subject: Re: Grant command help -- postgres