Re: Stalled post to pgsql-general

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Samba <saasira(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Stalled post to pgsql-general
Date: 2010-12-01 15:43:24
Message-ID: 16411.1291218204@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Samba <saasira(at)gmail(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2010-12-01 15:50:49 Re: Cannot start Postgres- FATAL: invalid cache id: 19
Previous Message mabra 2010-12-01 15:16:31 Looking for auto starting procedures