Samba <saasira@gmail.com> writes:
> REPOST!
Please fix the subject line to be something useful when you resend a
message.
>> 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.
You need to use array slice syntax if you want to extract a sub-array
rather than a single element. Try something like some_array[1:1]. See
http://www.postgresql.org/docs/9.0/static/arrays.html#ARRAYS-ACCESSING
regards, tom lane