Re: Stalled post to pgsql-general - Mailing list pgsql-general

From Tom Lane
Subject Re: Stalled post to pgsql-general
Date
Msg-id 16411.1291218204@sss.pgh.pa.us
Whole thread Raw
In response to Re: Stalled post to pgsql-general  (Samba <saasira@gmail.com>)
List pgsql-general
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

pgsql-general by date:

Previous
From:
Date:
Subject: Looking for auto starting procedures
Next
From: Tom Lane
Date:
Subject: Re: Cannot start Postgres- FATAL: invalid cache id: 19